ToastSystem.cs

A small GameObjectSystem that runs once during scene setup and ensures the active scene camera has ToastsDisplay and ScreenPanel components. It listens for FinishFixedUpdate stage, attaches the components if the camera is valid, then disposes itself.

Native Interop
public class ToastsSystem : GameObjectSystem
{
	public ToastsSystem( Scene scene ) : base( scene )
	{
		Listen( Stage.FinishFixedUpdate, 0, SetupGlobals, "SetupGlobals" );
	}

	void SetupGlobals()
	{
		var cam = Game.ActiveScene.Camera;
		if ( !cam.IsValid() )
			return;
		cam.GetOrAddComponent<ToastsDisplay>();
		cam.GetOrAddComponent<ScreenPanel>();
		Dispose();
	}
}