コード例 #1
0
        /// <summary>
        /// Pauses the game or unpauses it depending on the current state
        /// </summary>
        public virtual void Pause(PauseMethods pauseMethod = PauseMethods.PauseMenu)
        {
            if ((pauseMethod == PauseMethods.PauseMenu) && _inventoryOpen)
            {
                return;
            }

//			// if time is not already stopped
//			if (Time.timeScale>0.0f)
//            {
            MMTimeScaleEvent.Trigger(MMTimeScaleMethods.For, 0f, 0f, false, 0f, true);
            Instance.Paused = true;
            if ((GUIManager.Instance != null) && (pauseMethod == PauseMethods.PauseMenu))
            {
                GUIManager.Instance.SetPause(true);
                _pauseMenuOpen = true;
                SetActiveInventoryInputManager(false);
            }
            if (pauseMethod == PauseMethods.NoPauseMenu)
            {
                _inventoryOpen = true;
            }
//			}
//			else
//			{
//				UnPause(pauseMethod);
//                CorgiEngineEvent.Trigger(CorgiEngineEventTypes.UnPause);
//            }
            LevelManager.Instance.ToggleCharacterPause();
        }
コード例 #2
0
        /// <summary>
        /// Pauses the game or unpauses it depending on the current state
        /// </summary>
        public virtual void Pause(PauseMethods pauseMethod = PauseMethods.PauseMenu)
        {
            if ((pauseMethod == PauseMethods.PauseMenu) && _inventoryOpen)
            {
                return;
            }

            // if time is not already stopped
            if (Time.timeScale > 0.0f)
            {
                MMEventManager.TriggerEvent(new MMTimeScaleEvent(MMTimeScaleMethods.For, 0f, 0f, false, 0f, true));
                Instance.Paused = true;
                if ((GUIManager.Instance != null) && (pauseMethod == PauseMethods.PauseMenu))
                {
                    GUIManager.Instance.SetPause(true);
                    _pauseMenuOpen = true;
                    SetActiveInventoryInputManager(false);
                }
                if (pauseMethod == PauseMethods.NoPauseMenu)
                {
                    _inventoryOpen = true;
                }
            }
            else
            {
                UnPause(pauseMethod);
            }
            LevelManager.Instance.ToggleCharacterPause();
        }
コード例 #3
0
ファイル: GameManager.cs プロジェクト: sytme2zen/LDJam1005
 /// <summary>
 /// Unpauses the game
 /// </summary>
 public virtual void UnPause(PauseMethods pauseMethod = PauseMethods.PauseMenu)
 {
     MMTimeScaleEvent.Trigger(MMTimeScaleMethods.Unfreeze, 1f, 0f, false, 0f, false);
     Instance.Paused = false;
     if ((GUIManager.Instance != null) && (pauseMethod == PauseMethods.PauseMenu))
     {
         GUIManager.Instance.SetPause(false);
         _pauseMenuOpen = false;
         SetActiveInventoryInputManager(true);
     }
     if (_inventoryOpen)
     {
         _inventoryOpen = false;
     }
 }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: fkavum/infated
 /// <summary>
 /// Unpauses the game
 /// </summary>
 public virtual void UnPause(PauseMethods pauseMethod = PauseMethods.PauseMenu)
 {
     //InfEventManager.TriggerEvent(new InfTimeScaleEvent(InfTimeScaleMethods.Unfreeze, 1f, 0f, false, 0f, false));
     Instance.Paused = false;
     //if ((GUIManager.Instance!= null) && (pauseMethod == PauseMethods.PauseMenu))
     //      {
     //	GUIManager.Instance.SetPause(false);
     //	_pauseMenuOpen = false;
     //	SetActiveInventoryInputManager (true);
     //      }
     if (_inventoryOpen)
     {
         _inventoryOpen = false;
     }
 }
コード例 #5
0
 public override void Pause(PauseMethods pauseMethod = PauseMethods.PauseMenu)
 {
 }