A class in Root.Township, Alta.Networking.
Base of NetworkPrefab and NetworkScene. Holds the list of child network entities embedded in it, and gives each an EmbeddedId equal to its index.
Constructors
| Member | What it is |
|---|
NetworkEntityParent() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|
protected List<NetworkEntity> embeddedEntities | The child network entities embedded in this one, indexed by their embedded id. Backs Embedded. |
protected static Logger logger | NLog logger for this class. |
1 private and internal field
| Member | What it is |
|---|
private int nextSceneEntityId | Counter behind NextEmbeddedEntityId. |
Properties
| Member | What it is |
|---|
List<NetworkEntity> Embedded { get; } | Child entities embedded in this prefab or scene. An entity's EmbeddedId is its index here. |
bool IsEmbeddedUpdated { get; set; } | Set once embedded ids are assigned, so play mode doesn't redo it. |
1 private and internal property
| Member | What it is |
|---|
private int NextEmbeddedEntityId { get; } | Returns the next embedded id and increments it. Not called anywhere. |
Methods
| Member | What it is |
|---|
virtual void OnValidate() | Editor only: refreshes embedded ids and walks child entities whose nearest parent is this one. |
void RegisterEmbeddedEntity(NetworkEntity entity) | Empty in this build, so OnValidate doesn't actually add anything. |
protected void FindDuplicateHashes() | Empty in this build. |
protected virtual void UpdateEntityEmbeddedIds() | Removes null or self entries from the list and sets each entity's EmbeddedId to its index. |