SpatialOS entities: API - EntityBuilder
This document relates to both MonoBehaviour and ECS workflows
Before reading this document, make sure you are familiar with the documentation on entity templates.
EntityBuilder class to create entity templates. You use the
EntityTemplate class to specify all the components that a SpatialOS entity has, the initial values of those components, and which workers have write access to each component.
EntityBuilder class is part of the
Each method returns the
EntityBuilder instance using the builder design pattern (Wikipedia).
Create a new
EntityBuilder instance for creating an
.AddPosition(double x, double y, double z, string writeAccess)
Add a Position component to your entity and specify which worker type(s) can have authority over it.
.SetReadAcl(string attribute, param string attribute)
Specify which worker type(s) can have read access to the entity.
Specify which worker type can have write access over the EntityAcl component of your entity. This is useful if, while the game is running, you want to change which worker type(s) can have write-access over the entity’s other components.
.AddComponent(ComponentData data, string writeAccess)
Add a user-defined component to your entity and specify which worker type(s) can have [write access]((/unity/alpha/content/glossary#authority) over it.
Create a finished