コード例 #1
0
        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);
        }
コード例 #2
0
 public static void AddTimer(float duration, Action callback) => RoutineRunner.RunRoutine(RunTimer(duration, callback));
コード例 #3
0
 private void FrameCoroutines() => RoutineRunner.FrameSubset(attachedCoroutines);
コード例 #4
0
 public static void AddTimer(int frames, Action callback) => RoutineRunner.RunRoutine(RunTimer(frames, callback));