WorldCellReference Class

public sealed class WorldCellReference : MonoBehaviour

This is basically a wrapper for a WorldCell. It will be added to each game object (chunk) that is loaded for your world, so long as the Add World Cell References option is enabled on your World component, World Grouping, or LOD. This monobehaviour is solely meant to store a reference to the WorldCell the chunk/chunk belongs to, as well as the index of the chunk/chunk in the World Cell for multi chunk situations. The idea is to give you a way to access the WorldCell (which contains a bunch of useful information about the object and the cell it belongs to), in situations where you have access to the object itself. You can use GetComponent<WorldCellReference> to access the WorldCellReference class, and then the WorldCell property to access the WorldCell itself.

By default, World Cell References are disabled, to avoid allocating extra memory for a potentially uneeded use case.

Properties

Name Type Description
ChunkIndex int

The chunk index of this game object. Remember that when using multi chunking, a World Cell can "own" several chunks.

WorldCell WorldCell

Gets the World Cell the game object belongs to.