Exemple #1
0
        public void TogglePause()
        {
            GameClock c = GameClock.Instance(); if (c.isPaused)

            {
                c.Unpause();
            }
            else
            {
                c.Pause();
            }
        }
Exemple #2
0
 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);
 }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
 public void Unpause()
 {
     GameClock.Instance().Unpause();
 }
Exemple #5
0
 public void Pause()
 {
     GameClock.Instance().Pause();
 }