Skip to main content

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.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private Renderer[] renderersThe renderers the cave layer streamer controls.
private CaveLayerStreamer streamerThe cave layer streamer the renderers were registered with.

Methods​

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