static int Main(string[] args) { Application app = new Application("New Pillar Game"); Time time = new Time(); GlobalPersistantUpdate = time.Frame; RoutineRunner runner = new RoutineRunner(); Level main = new Level("main"); while (!exit) { Input.Poll(); if (!GlobalPause) { GlobalUpdate?.Invoke(); } GlobalPersistantUpdate(); if (ThreadManager.Frame()) { Thread.Sleep(1); } Console.Write($"\r{Time.SampleCount}: {1f/Time.SmoothDeltaTime} "); if (Input.GetKeyDown(Key.Up)) { Time.SampleCount += 100; } } return(0); }
public static void AddTimer(float duration, Action callback) => RoutineRunner.RunRoutine(RunTimer(duration, callback));
private void FrameCoroutines() => RoutineRunner.FrameSubset(attachedCoroutines);
public static void AddTimer(int frames, Action callback) => RoutineRunner.RunRoutine(RunTimer(frames, callback));