Skip to main content

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.

Constructors​

1 private and internal constructor
MemberWhat it is
private DebugLoadMarker(NetworkEntity entity)Creates a DebugLoadMarker from entity.

Fields​

6 private and internal fields
MemberWhat it is
private DebugLoadMarker.IChunkLoader chunkLoaderThe loader that picks which chunks to keep loaded.
private HashSet<Chunk> currentLoadedChunksChunks this marker currently force loads.
private static HashSet<Chunk> dynamicListShared scratch set filled by the loader each update.
private NetworkEntity entityThe entity being followed.
private Transform transformThe entity's transform, checked for movement.
private IUnityUpdateMethod updateHandle for the registered late update method.

Methods​

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