Skip to main content

ProfileChunkLoading

A class in Root.Township, the global namespace.

Debug tool: force-loads the chunks around each listed position in turn, timing the load and unload and logging FPS and entity counts.

Constructors​

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

Fields​

7 private and internal fields
MemberWhat it is
private Coroutine currentProfileThe running coroutine.
private bool isStartingInspector button that starts the run.
private int iterationsHow many times to go through the positions (default 10).
private static Logger loggerThe ChunkLoading NLog logger.
private List<ProfileChunkLoading.ProfilingPosition> positionsBacking field for Positions.
private ProfileChunkLoading.ProfileData profilingDataResults for the current position.
private HashSet<Chunk> waitingForChunks not yet loaded or unloaded.

Properties​

MemberWhat it is
List<ProfileChunkLoading.ProfilingPosition> Positions { get; }The positions to profile.

Methods​

MemberWhat it is
IEnumerator Profile() (iterator)Coroutine that runs every position for each iteration, with server diagnostics off, and logs the results to the ChunkLoading logger.
void StartProfiling()Starts the run if one isn't already going.
3 private and internal methods
MemberWhat it is
private void MarkAsLoaded(Chunk loadedChunk)Removes a chunk from the wait list once fully loaded.
private void MarkAsUnloaded(Chunk loadedChunk)Removes a chunk from the wait list once fully unloaded.
private void OnDrawGizmos()Draws a sphere at each position.