public void TogglePause() { GameClock c = GameClock.Instance(); if (c.isPaused) { c.Unpause(); } else { c.Pause(); } }
public static GameClock Instance() { if (s_instance != null) { return(s_instance); } s_instance = FindObjectOfType <GameClock>(); if (s_instance == null) // if it doesn't exist { GameObject g = new GameObject("<Clock>"); s_instance = g.AddComponent <GameClock>(); // create one } return(s_instance); }
void Start() { #if UNITY_EDITOR onUnityEditorStart.Invoke(); #endif #if UNITY_WEBPLAYER onWebplayerStart.Invoke(); #endif #if UNITY_ANDROID || UNITY_IPHONE onMobileStart.Invoke(); #endif if (onPause != null) { GameClock.Instance().pauseEvents.onPause.AddListener(onPause.Invoke); } if (onUnpause != null) { GameClock.Instance().pauseEvents.onUnpause.AddListener(onUnpause.Invoke); } }
public void Unpause() { GameClock.Instance().Unpause(); }
public void Pause() { GameClock.Instance().Pause(); }