Nebula
World partition

ChunkContent

Scene-object form of NebulaChunks.Loaded/NebulaChunks.Unloading: drop a subclass in the game scene and override OnChunkLoaded.

generated from the sources
Abstract class in namespace Nebula.World · Packages/com.1by3.nebula/Runtime/World/ChunkContent.cs
public abstract class ChunkContent : MonoBehaviour

Scene-object form of NebulaChunks.Loaded/NebulaChunks.Unloading: drop a subclass in the game scene and override OnChunkLoaded. It exists because a chunk generator is usually authored content — a prefab list, a material, a noise setting — and a MonoBehaviour is where a Unity developer expects to put those, whereas the static events are what a headless service or a test wants. Both paths are the same events; use whichever reads better.

Subscription happens in OnEnable, and NebulaChunks.Loaded back-fills, so a component enabled long after the first chunks arrived still builds all of them.

Methods

OnEnable

protected virtual void OnEnable();

OnDisable

protected virtual void OnDisable();

OnChunkLoaded

protected abstract void OnChunkLoaded(in ChunkContext chunk);

Build this chunk's content under ChunkContext.Root. Runs on every role.

OnChunkUnloading

protected virtual void OnChunkUnloading(in ChunkContext chunk);

The chunk is about to be destroyed, with everything under its root. Only override to release things kept elsewhere.

On this page