Script Reference

TickManager.cs

Authoritative simulation clock for Tile Tick Movement. It advances fixed simulation ticks and broadcasts tick events for gameplay systems.

CoreSimulationSingleton

Overview

TickManager is the central timing system for the package. Core gameplay logic should respond to ticks instead of relying directly on Unity's Update loop.

This keeps movement and future gameplay systems consistent even when the visual frame rate changes.

Inspector Settings

Tick Interval

Time in seconds between simulation ticks. Lower values make the simulation advance more frequently. Higher values create a slower, chunkier tick rhythm.

Start Paused

When enabled, the simulation starts paused and will not advance until resumed through code.

Public API

StepOneTick()

Immediately advances the simulation by exactly one tick. Useful for debugging or manual stepping while paused.

SetPaused(bool paused)

Sets whether the tick loop is paused.

TogglePaused()

Switches the tick loop between paused and unpaused.

GetTickProgress01()

Returns a 0-1 value showing how far the current tick interval has progressed.

OnTick

Event fired once for every simulation tick. Subscribe gameplay systems here when they need to process logic on the tick.

Runtime Properties

TickIntervalCurrent configured tick interval.
CurrentTickCurrent simulation tick number.
IsPausedWhether the tick loop is currently paused.

Common Usage

TickManager.Instance.OnTick += HandleTick;

private void HandleTick(long tick)
{
    // Run gameplay logic here.
}