A class in Root.Township, the global namespace.
Network entity component that instantiates a list of static prefabs under itself. Clients spawn them from a sync; the server spawns them when asked, for example in micro tutorial dynamic content.
Constructors
| Member | What it is |
|---|
AdditionalStaticContent() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|
static bool IsBaking | Static flag set during baking, which stops the editor gizmo preview. |
4 private and internal fields
| Member | What it is |
|---|
private Transform mTransform | Backing field for Transform. |
private bool needsToInstantiate | Whether clients should spawn the content. Saved. |
private AdditionalStaticContent.StaticContent[] staticContent | The prefabs to spawn, with their local transforms. |
private MethodSync sync | Method sync for the content flag. |
Properties
| Member | What it is |
|---|
Transform Transform { get; } | Cached transform. |
Methods
| Member | What it is |
|---|
override void Initialize() | Creates the method sync for the content flag. |
void InstantiateContent(Transform parent, HideFlags hideFlags = 0) | Instantiates every configured prefab under the parent with its local position, rotation and scale. |
override void OnConnected(Player player) | Sends the content flag to the joining player. |
3 private and internal methods
| Member | What it is |
|---|
private void InstantiateContentEditor() | Empty in this build. |
private void OnDrawGizmos() | Editor preview hook. Does nothing in this build. |
private void Sync(IPlayer player, Stream stream) | Method sync body for needsToInstantiate. Clients and local test spawn the content when the flag is set. |