A class in Root.Township, the global namespace.
Replaces this entity with another prefab at the same position and rotation. Server only; subclasses can change what happens to the old entity.
Constructors
| Member | What it is |
|---|
GenericReplacer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private bool btnReplace | Inspector button that runs Replace. |
private NetworkPrefab targetPrefab | Prefab spawned in place of this one. |
Methods
| Member | What it is |
|---|
void Replace() | Server: spawns targetPrefab in this entity's chunk and calls OnReplace. |
protected virtual void OnReplace(NetworkEntity replacing) | Called with the new entity after spawning. By default destroys this entity. |