You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
proepkes edited this page Feb 19, 2019
·
3 revisions
In the Unity project there is an entity-database which contains all spawnable prefabs that exist in the simulation. The following steps are made when a spawn-command is issued by an actor:
the spawn command sets which entity should be spawned by calling AddDatabaseEntityID on the inputEntity
`
public class SpawnCommand : ICommand
{
public void Execute(InputEntity e)
{
e.AddCoordinate(Position);
e.AddDatabaseEntityId(DatabaseEntityId);
}
the framework receives the command and creates a new game-entitiy
3.1) some necessary components are added to the game-entity (e.g. ID-fields and position)
the game-entity gets passed to Unity in addition to the provided database-entity-id
Unity looks up the database-entity-id and instantiates a new gameobject
additional MonoBehaviours on the gameObject add components to the game-entity