Skip to main content

AdditionalStaticContent

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​

MemberWhat it is
AdditionalStaticContent()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

MemberWhat it is
static bool IsBakingStatic flag set during baking, which stops the editor gizmo preview.
4 private and internal fields
MemberWhat it is
private Transform mTransformBacking field for Transform.
private bool needsToInstantiateWhether clients should spawn the content. Saved.
private AdditionalStaticContent.StaticContent[] staticContentThe prefabs to spawn, with their local transforms.
private MethodSync syncMethod sync for the content flag.

Properties​

MemberWhat it is
Transform Transform { get; }Cached transform.

Methods​

MemberWhat 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
MemberWhat 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.