-
Notifications
You must be signed in to change notification settings - Fork 2
ISystem
Martin Evans edited this page Aug 1, 2024
·
1 revision
The most basic type of system inherits from ISystem:
public interface ISystem<in TData>
{
public void Update(TData data);
}TData specifies the data that is passed into Update, for example this could be a GameTime struct or something similar.
If a system needs one time setup before the first update call, it should implement ISystemInit:
public interface ISystemInit<in TData>
: ISystem<TData>
{
public void Init();
}Updates happen every frame, in three phases: BeforeUpdate, Update, AfterUpdate. Systems may implement ISystemBefore and ISystemAfter to participate in the other two phases.