SimpleTick: A Lightweight, Zero-GC Tick System for Unity

Stop cluttering your code with timers in Update() or messy coroutines. SimpleTick is a zero-GC tick scheduler for Unity that lets you run methods at set intervals with clean [Tick] attributes or dynamic OnTick.Schedule() calls. It supports both scaled time (paused with the game) and unscaled time (real-time) and is perfect for cooldowns, periodic logic, and background tasks.

This system is useful for:

  • Cooldowns and ability timers
  • Health regeneration ticks
  • AI pathfinding or scan intervals
  • Save autosync or cloud checks
  • Multiplayer ping/polling intervals
  • Time-based UI updates (e.g., clock, event countdown)
  • Lightweight alternative to coroutines or InvokeRepeating
  • Any situation where you want repeatable or one-off timed execution

Just drop it in and go. One component handles everything. No reflection, no magic. Just clean, fast execution.

Key Features:

  • Attribute-Based Callbacks: Use [Tick(interval, mode)] on parameterless methods for effortless scheduling.
  • Dynamic Scheduling API: Call OnTick.Schedule() or OnTick.ScheduleOnce() at runtime to queue repeatable or one-time logic.
  • GC-Free Scheduling: Use OnTick.ScheduleNoAlloc() to schedule ticks with zero garbage collection allocation.
  • Scaled and Unscaled Time: Supports both Time.deltaTime and Time.unscaledDeltaTime using TickMode for full control over game-time or real-time updates.
  • Pause and Resume Support: Pause or resume individual ticks at runtime for flexible control.
  • Single Component Management: A single OnTick component manages all tick logic in the scene.
  • No Reflection: [Tick] methods are compiled directly into delegates for fast, efficient invocation.
  • Drop-In Integration: Simply add OnTick to a GameObject to get started.
  • Clean, Lightweight API: The codebase is readable, minimal, and free of external dependencies.
  • TickValidator: Automatically verifies [Tick] methods on scene load to ensure they are valid and safe to run.
  • Scoped Tick Handles: TickHandle implements IDisposable, allowing automatic unscheduling using using blocks.
  • Custom Error Handling: Assign error callbacks to individual ticks to handle failures safely without halting the scheduler.
  • Supports Up to 3 Arguments: Dynamically scheduled methods can accept up to three parameters using overloads.
  • MonoBehaviour-Decoupled Backend: Core tick logic is decoupled from Unity's Update() loop.
  • Fully Documented: Includes in-code XML summaries, usage examples, and integration notes for every feature.

SimpleTick: A Lightweight, Zero-GC Tick System for Unity - Asset Store

πŸ€– Chat with AI

AI is typing

Suggested Posts

LaneGraph: A Lightweight Lane-Based Navigation System for Unity

LaneGraph: A Lightweight Lane-Based Navigation System for Unity Thumbnail

Dead-Simple Dialogue: A Linear Dialogue System for Unity

Dead-Simple Dialogue: A Linear Dialogue System for Unity Thumbnail

PathGrid: A Grid-Based Path System for Unity

PathGrid: A Grid-Based Path System for Unity Thumbnail

XSGridEditor: A Lightweight Grid Map System for 2D/3D SRPG Games

XSGridEditor: A Lightweight Grid Map System for 2D/3D SRPG Games Thumbnail

Gen Events: A Simple Observer Pattern for Unity

Gen Events: A Simple Observer Pattern for Unity Thumbnail

SimpleHTTP: A Lightweight HTTP Client for Unity

SimpleHTTP: A Lightweight HTTP Client for Unity Thumbnail