/// <summary> /// /// </summary> /// <param name="pause"></param> public void Pause(bool pause) { if (pause && _gameState != GAME_STATE.IDLE) { _lastState = _gameState; _gameState = GAME_STATE.IDLE; LeanTween.pauseAll(); } else if (!pause && _gameState == GAME_STATE.IDLE) { _gameState = _lastState; LeanTween.resumeAll(); } _currentLevel.Pause(pause); _fruitTree.Pause(pause); _strikerMonkey.Pause(pause); _collectorMonkey.Pause(pause); foreach (Guard g in _guardPool) { if (g.gameObject.activeSelf) { g.Pause(pause); } } //AudioController.PauseMusic(_currentStage.au); //0.2s fade out }
private void Start() { if (lerpEnemies) { LeanTween.pauseAll(); } }
private void Update() { if (gameStarted && !GameIsPaused) { if (canDropTimer) { StartCoroutine(CountDown()); } if (canIncreaseReward) { StartCoroutine(IncreaseBonusReward()); } if (gameTimer <= 210 && !lightsAreOn) { lightsAreOn = true; EventSystemGame.current.TurnLightsOn(); } if (gameTimer <= 0) { EventSystemGame.current.GameOver(); //call the gameover event EventSystemGame.current.PlaySound("GameOver"); EventSystemGame.current.StopSound("Music"); LeanTween.pauseAll(); gameStarted = false; } } }
private void SuperHit() { Debug.Log("doing super hit"); playerStatsLogic.powerUpModeActive = PowerUpType.SUPERHIT; touch.SetDisableMovment(); movmentLogic.ResetRotation(); animationLogic.SetDashing(); LeanTween.cancel(character.gameObject, true); // var playerPosition = character.transform; var enemies = GameObject.FindGameObjectsWithTag("Enemy"); LeanTween.pauseAll(); Time.timeScale = 0f; originalStr = playerStatsLogic.Strength; playerStatsLogic.Strength = 100; Stack <GameObject> enemiesObject = new Stack <GameObject>(); foreach (var enemy in enemies) { if (insideScreen(enemy.transform)) { enemiesObject.Push(enemy); var enemyCollider = enemy.GetComponent <Collider2D>(); enemyCollider.enabled = false; } } punchEnemies(enemiesObject); if (enemiesObject.Count == 0) { finishedSuperHit(); } }
private void Init(IAIManagerService aiManagerService, IStateManager stateManager) { _aiManagerService = aiManagerService; _stateManager = stateManager; _aiManagerService.PauseAI(true); LeanTween.pauseAll(); }
private void SetMovement(bool _Value) { if (_Value) { LeanTween.pauseAll(); } else { LeanTween.resumeAll(); } }
/// <summary> /// Toggles Game-Pause /// </summary> public void TogglePause() { Paused = !Paused; if (Paused) // This is nasty, but it should work. It pauses ALL active tweens, but still allows new tweens to be started/ran. { LeanTween.pauseAll(); } else { LeanTween.resumeAll(); // Resumes ALL tweens (including the ones that are NOT in GameState.Playing } }
public void PauseGame(bool _showPause = true) { FindObjectOfType <SCR_Timer>().isPaused = true; FindObjectOfType <SCR_InputManager>().isPaused = true; FindObjectOfType <SCR_Player>().isPaused = true; if (_showPause) { pauseMenu.SetActive(true); pauseMenu.GetComponentInChildren <Button>().Select(); Debug.Log("Button selecte!"); } LeanTween.pauseAll(); }
public void manejarPausa() { pausa = !pausa; // Le digo a todas las inferfaces que manejen su pausa foreach (IPersonajeMapa unaInterfaz in listaInterfaces) { unaInterfaz.manejarPausa(); } if (pausa) { LeanTween.pauseAll(); } else { LeanTween.resumeAll(); } }
/*public void StartMinigame() * { * Core.ChangeScene.MainMenu.StartMinigame(current.currentMinigameID); * }*/ public void StartMinigame(AllScenes scene) { LeanTween.pauseAll(); Core.ChangeScene.MainMenu.LoadByName(scene.ToString()); }
// pauses the time if players manages to answer before it runs out. public void Pause() { LeanTween.pauseAll(); }
public void Pause() { paused = true; LeanTween.pauseAll(); }
private void OnGamePause() { _rigidbody.constraints = RigidbodyConstraints.FreezeAll; LeanTween.pauseAll(); }
// Code that runs on entering the state. public override void OnEnter() { LeanTween.pauseAll(); Finish(); }
public void OnEnter() { LeanTween.pauseAll(); _ui.Pause(); }
public static void LTPauseAll(this Transform self) { LeanTween.pauseAll(); }