DebugLoadMarker
A class in Root.Township, Alta.QATools.
QA helper that keeps the chunks around an entity force loaded as it moves, as if a player stood there. Made by a debugging console command through Setup.
- Listed in Console, logging and analytics
- Nested types
IChunkLoader,NormalChunkLoader,OptimisedChunkLoader
Constructors
1 private and internal constructor
| Member | What it is |
|---|---|
private DebugLoadMarker(NetworkEntity entity) | Creates a DebugLoadMarker from entity. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private DebugLoadMarker.IChunkLoader chunkLoader | The loader that picks which chunks to keep loaded. |
private HashSet<Chunk> currentLoadedChunks | Chunks this marker currently force loads. |
private static HashSet<Chunk> dynamicList | Shared scratch set filled by the loader each update. |
private NetworkEntity entity | The entity being followed. |
private Transform transform | The entity's transform, checked for movement. |
private IUnityUpdateMethod update | Handle for the registered late update method. |
Methods
| Member | What it is |
|---|---|
static void Setup(NetworkEntity entity) | Attaches a load marker to an entity. Uses the optimised loader on a simple server, the normal one otherwise. |
3 private and internal methods
| Member | What it is |
|---|---|
private void Disable(NetworkEntity entity, bool isUnload) | Stops the late update when the entity is destroyed. Chunks it force loaded are not released. |
private void Update() | Late update: recalculates loaded chunks when the entity's transform has moved. |
private void Updatechunks() | Force loads the chunks the loader picks for the entity's position and un-force-loads ones no longer needed. |