From ce61a784968de6510db6df005ee7659644ad6c31 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 21 Apr 2022 10:16:07 +0800 Subject: *misc --- AlienSurvival/Assets/Scripts/Utils/GameLoop.cs | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 AlienSurvival/Assets/Scripts/Utils/GameLoop.cs (limited to 'AlienSurvival/Assets/Scripts/Utils/GameLoop.cs') diff --git a/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs b/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs new file mode 100644 index 0000000..e22ed77 --- /dev/null +++ b/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class GameLoop : MonoBehaviour +{ + + static GameLoop m_GameLoop; + + static public GameLoop instance + { + get + { + return m_GameLoop; + } + } + + int m_IndexOfUpdate = 0; + + public int indexOfUpdate + { + get + { + return m_IndexOfUpdate; + } + } + + private void Awake() + { + m_GameLoop = this; + } + + private void Update() + { + ++m_IndexOfUpdate; + } + +} -- cgit v1.1-26-g67d0