CaveLayerStaticObject
A class in Root.Township, Alta.Chunks.
Networked object inside a cave layer that registers its renderers with the cave layer's streamer, so they show and hide with the layer. Client only: does nothing on a headless server.
- Listed in World, chunks and saving
- Inherits or implements
NetworkEntityBehaviour,IBuildRendererPostBake,IBuildBakeable
Constructors
| Member | What it is |
|---|---|
CaveLayerStaticObject() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|---|
private Renderer[] renderers | The renderers the cave layer streamer controls. |
private CaveLayerStreamer streamer | The cave layer streamer the renderers were registered with. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | After the base setup, waits half a second and then registers with the cave layer streamer. Skipped when headless. |
4 private and internal methods
| Member | What it is |
|---|---|
private void IBuildRendererPostBake.PostBake() | At build time, removes null entries from the renderer list. |
private void RemoveRenderers(NetworkEntity entity, bool isUnload) | Deregisters the renderers from the streamer when the entity is destroyed by the scene. |
private void SetupCaveLayerStreamer() | Finds the chunk at this position and, if its procedural streamer is a cave layer, registers the renderers with it. |
private bool TryGetCaveLayerStreamer(LocationChunk chunk, out CaveLayerStreamer outStreamer) | Gets the chunk's procedural streamer if it is a CaveLayerStreamer. |