Skip to main content

ISerializeChildren

An interface in Root.Township, Alta.Networking.

Passed to ISavable load and save methods so a component can save and restore the child prefabs spawned under its entity.

Properties​

MemberWhat it is
int ChildCount { get; }Number of child entries.
List<NetworkPrefab.ChildPrefab> ChildPrefabs { get; }The child prefab entries.

Methods​

MemberWhat it is
void AddChild(NetworkEntity parent, NetworkPrefab child)Records a spawned child prefab under a parent entity.
void AddEmptyChildAtIndex(int index)Adds an empty placeholder at a child index.
int GetChildIndex(NetworkPrefab child)Index of a child entry, looked up by child prefab or by parent entity.
int GetChildIndex(NetworkEntity parent)Index of a child entry, looked up by child prefab or by parent entity.
void GetSpawnedChildren(int index, NetworkPrefabChildEventHandler callback)Calls back with the children spawned for the entry at an index.

Used in​

Members of other types that take, return or hold a ISerializeChildren: