The UpdateSystem lets plain C# objects receive a once-per-frame tick without inheriting from MonoBehaviour. Objects implement IUpdateable, and the system drives them from Unity's PlayerLoop Update phase.
Purpose in SaffronLibrary
The system sits in the _Core/Infrastructure layer. It keeps the per-frame logic in pure C# (UpdateManager) and confines the Unity-specific timing to a small adapter (UnityUpdateAdapter). Other systems reach it through the command bus rather than by holding a reference to the manager.
Key responsibilities
- Maintain an ordered registry of
IUpdateableobjects and callOnUpdateon each one every tick (UpdateManager). - Connect the engine heartbeat to the manager through
IUpdateAdapter.UnityUpdateAdapterinjects the tick into the PlayerLoopUpdatephase usingUpdateServiceandUpdateUtility. - Accept registration requests sent as
Registercommands on theUpdatedomain.UpdateCommandFactory.RegisterUpdatablebuilds and sends these, andUpdateFlowControllerroutes them to the manager.
Who should use it
- Gameplay or service developers who need a per-frame callback on a non-
MonoBehaviourclass. - Infrastructure maintainers who work on the engine bridge or PlayerLoop integration.
Connections to other systems
The system depends on the Contracts system for the Domain enum (it uses Domain.Update), on the Params system for typed command payloads, on the Commands system for building commands, and on the Bus system for sending them. It also extends the Flow system's FlowController base class so it can receive commands for its domain.