diff options
author | chai <chaifix@163.com> | 2022-04-22 09:24:15 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-04-22 09:24:15 +0800 |
commit | 06df35f1e8e9695b844553867a39cd12d68db8b4 (patch) | |
tree | 3af5c78db3d84bfe8bbea26a54031cf0b1169f7e /AlienSurvival/Assets/Scripts/Utils/GameLoop.cs | |
parent | ea0717eba0b624d47bd60edba7fb7862633f2f5f (diff) |
*arrow
Diffstat (limited to 'AlienSurvival/Assets/Scripts/Utils/GameLoop.cs')
-rw-r--r-- | AlienSurvival/Assets/Scripts/Utils/GameLoop.cs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs b/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs index 6bbb140..6ae7d87 100644 --- a/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs +++ b/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs @@ -2,18 +2,17 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -public class GameLoop : MonoBehaviour +public class GameLoop : Singleton<GameLoop> { - static public GameLoop Instance { get; private set; } - public int indexOfUpdate { get; private set; } = 0; - - private void Awake() + public GameLoop() { - Instance = this; + indexOfUpdate = 0; } - private void Update() + public int indexOfUpdate { get; private set; } = 0; + + public void Update() { ++indexOfUpdate; } |