From 06df35f1e8e9695b844553867a39cd12d68db8b4 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 22 Apr 2022 09:24:15 +0800 Subject: *arrow --- AlienSurvival/Assets/Scripts/Utils/GameLoop.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'AlienSurvival/Assets/Scripts/Utils/GameLoop.cs') 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 { - 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; } -- cgit v1.1-26-g67d0