public void OnOpen(object data) { if (data == null) { Debug.LogErrorFormat("GameOverViewModule.Open(GameOverType) is null "); return; } GameOverType type = (GameOverType)data; var dic = ViewTools.CollectAllGameObjects(m_gameObject); m_button = dic["GameOverButton"].GetComponent <Button>(); if (m_button != null) { m_button.onClick.AddListener(OnClickButton); } m_winObj = dic["win"]; m_failureObj = dic["lose"]; if (m_winObj != null) { m_winObj.SetActive(type == GameOverType.Win); } if (m_failureObj != null) { m_failureObj.SetActive(type == GameOverType.Failure); } }
/// <summary> /// 结束游戏 /// 1.生命已耗尽 or /// 2.鸟窝已爆炸 or /// 3.时间已规0 /// </summary> public void IsGameOvoer(GameOverType gameOverType) { m_IsGameOver = true; UIManager.isGameOver = true; switch (gameOverType) { case GameOverType.notLife: UIManager.GetInstance.txt_GameOverCause.text = "死因:没有剩余生命"; break; case GameOverType.coreDestory: try { GameObject core = GameObject.FindWithTag("Core"); Debug.Log(core); core.GetComponent <SpriteRenderer>().sprite = eff_CoreDestory; Instantiate(go_Destory, core.transform.position, transform.rotation); } catch (System.Exception) { throw; } UIManager.GetInstance.txt_GameOverCause.text = "死因:鸟窝被毁"; break; case GameOverType.notTime: UIManager.GetInstance.txt_GameOverCause.text = " 死因:规定时间内未歼灭敌人"; break; default: break; } }
public void GameOver(GameOverType type) { MusicPlayer.Instance.PlayFail(); TriggerForEnd.gameObject.SetActive(false); JayAudioManager.Instance.Stop(); MainMenuManager.Instance.GameOver(type); }
public void EnableFruitRb() { switch (meterController.colorPicker) { case 1: for (int i = 0; i < fruitLists.Count; i++) { fruitLists[i].useGravity = true; } break; case 2: for (int i = 0; i < 2; i++) { fruitLists[i].useGravity = true; } gameOverType = GameOverType.Lose; break; case 3: fruitLists[0].useGravity = true; gameOverType = GameOverType.Lose; break; } treeType++; Manager.sharedManager().isGameStarted = false; StartCoroutine(ChangeCamPosition()); }
void Awake() { Debug.Log(Application.persistentDataPath); ///AppData/LocalLow/DefaultCompany/Blackhole + .... configFile = Application.persistentDataPath + "/config.dat"; scoreFile = Application.persistentDataPath + "/score.dat"; GOTy = GameOverType.NOTHING; ScoreNames = new string[5]; ScoreResults = new string[5]; if (GameStats == null) { GameStats = this; DontDestroyOnLoad(gameObject); } else if (GameStats != this) { Destroy(gameObject); } //if (InitialMusicScreen == null) //{ // == this; // DontDestroyOnLoad(gameObject); //}else //{ //} }
public void ShowGameOver(GameOverType type) { string message = string.Empty; Image image; switch (type) { case GameOverType.Victory: message = UIConstants.MSG_VICTORY; image = Properties.Resources.VictorySoldier; break; case GameOverType.VictoryCommander: message = UIConstants.MSG_VICTORY_COMMANDER; image = Properties.Resources.VictoryCommander; break; case GameOverType.Defeat: message = UIConstants.MSG_DEFEAT; image = Properties.Resources.Defeat; break; default: throw new InvalidEnumArgumentException(); } btnClose.Image = image; messageBox.Text = message; this.ShowDialog(); }
IEnumerator ShowGameOverScreenAfterDelay(float delay, GameOverType type) { IsAlive = false; yield return(new WaitForSeconds(delay)); ShowGameOverScreen(type); }
public void ShowEndScreen(GameOverType type) { endGameScreens[(int)type].SetActive(true); if (type == GameOverType.Lose) GameObject.Find("DefeatDescription").GetComponent<TextMeshProUGUI>().text = gameOverDescriptions[Random.Range(0, gameOverDescriptions.Length + 1)]; }
private void OnChangeGameState(GameStates state, GameOverType gameOverType) { if (state == GameStates.GameOver) { _enemyTanksWidgetMediator.Reset(); } }
public void GameOver(GameOverType gameOverType) { if (!useMecanim) { thisAnimation.Stop(runAnimationName); } if (gameOverType != GameOverType.Quit) { if (gameOverType == GameOverType.JumpObstacle) { if (useMecanim) { thisAnimator.SetBool(forwardDeathAnimationName, true); } else { thisAnimation.CrossFade(forwardDeathAnimationName); } } else { if (useMecanim) { thisAnimator.SetBool(backwardDeathAnimationName, true); } else { thisAnimation.CrossFade(backwardDeathAnimationName); } } } }
void Awake() { Instance = this; m_allEntities = new List <Entity>(); m_activeEnemies = new List <Enemy>(); m_activeNPCs = new List <NPC>(); m_player = null; m_spawners = new List <EnemySpawner>(FindObjectsOfType <EnemySpawner>()); m_gameOver = GameOverType.None; m_gameOverScreen = FindObjectOfType <GameOver>(); if (m_gameOverScreen != null) { m_gameOverScreen.gameObject.SetActive(false); } m_killedCreatureCount = m_killedNPCCount = 0; m_spawnedCreatures = m_spawnedNPCCount = 0; m_elapsed = 0.0f; m_boundaries = new Rect(); Camera cam = Camera.main; float camHHeight = cam.orthographicSize; float camHWidth = camHHeight * cam.aspect; cam.transform.position.Set(0, 0, cam.transform.position.z); m_boundaries.x = -camHWidth; m_boundaries.width = camHWidth * 2; m_boundaries.y = 2 * camHHeight; m_boundaries.height = camHHeight * 4; // At the moment there are two areas on top of each other }
public void gameOver(GameOverType gameOverType, bool waitForFrame) { if (!gameActive && waitForFrame) { return; } gameActive = false; if (waitForFrame) { StartCoroutine(waitForFrameGameOver(gameOverType)); } else { inputController.gameOver(); // Mission Manager's gameOver must be called before the Data Manager's gameOver so the Data Manager can grab the // score multiplier from the Mission Manager to determine the final score missionManager.gameOver(); dataManager.gameOver(); playerController.gameOver(gameOverType); audioManager.playBackgroundMusic(false); audioManager.playSoundEffect(SoundEffects.GameOverSoundEffect); guiManager.gameOver(); // cameraController.setPlayerAsParent(false); } }
public void SetGameOverType(GameOverType gameOver) { timer = Time.time; m_init = true; m_canvas.gameObject.SetActive(true); switch (gameOver) { case GameOverType.None: break; case GameOverType.PlayerDeath: m_Death.gameObject.SetActive(true); break; case GameOverType.Genocidal: m_Resistance.gameObject.SetActive(true); m_GenocidalSub.gameObject.SetActive(true); break; case GameOverType.Extermination: m_Extermination.gameObject.SetActive(true); break; case GameOverType.Resistance: m_Resistance.gameObject.SetActive(true); m_PacifistSub.gameObject.SetActive(true); break; case GameOverType.Psychopath: m_Resistance.gameObject.SetActive(true); m_PsychopathSub.gameObject.SetActive(true); break; default: break; } }
void ShowGameOverScreen(GameOverType type) { IsAlive = false; GameOverScreen.gameObject.SetActive(true); GameOverScreen.GetComponent <Animator>().SetTrigger("Appear"); GameOverScreen.SetSprite(type); timer.Stop(); }
public void gameOver(GameOverType gameOverType) { playerAnimation.gameOver(gameOverType); thisRigidbody.velocity = Vector3.zero; collisionParticleSystem.transform.parent = null; enabled = false; gameManager.onPauseGame -= gamePaused; }
void GameOverScreen(GameOverType winner) { timeText.transform.parent.gameObject.SetActive(false); gameUI.transform.Find("GameOver").gameObject.SetActive(true); Image gameOverBackground = gameUI.transform.Find("GameOver/Background").GetComponent <Image>(); gameUI.transform.Find("GameOver/Game Over/Winner").GetComponent <Text>().text = winner == GameOverType.Bear ? "Bear Wins" : "Bear Loses"; //gameOverBackground.sprite = Resources.Load<Sprite>(string.Format("GameOver_{0}", type.ToString())); }
public void GameOver(GameOverType gameOverType) { // attack if (gameOverType == GameOverType.DuckObstacle || gameOverType == GameOverType.JumpObstacle) { thisAnimation.Play(attackAnimationName); attackParticles.Play(); } else { thisAnimation.Stop(); } }
private void GameOver(GameOverType gameOverType) { IsEnemySpawning = false; IsGameRunning = false; ClearEnemies(); if (OnGameOver != null) { OnGameOver(gameOverType); } }
public void DisplayGameOver(float score, int days, GameOverType gameOverType) { _reasonDisplay.text = gameOverType switch { GameOverType.NoMoneyLeft => "You have no money left.", GameOverType.NoZoneleft => "There is no fishing zone left.", _ => "", }; _scoreDisplay.text = string.Format("Total score: {0}", score); _dayDisplay.text = string.Format("Total days: {0}", days); }
private void OnGameOver(GameOverType gameOverType) { if (gameOverType == GameOverType.Lose) { _musicSource.PlayOneShot(_settings.GameOverLose); } else if (gameOverType == GameOverType.Win) { _musicSource.PlayOneShot(_settings.GameOverWin); } }
// Game over may be called from a trigger so wait for the physics loop to end private IEnumerator waitForFrameGameOver(GameOverType gameOverType) { yield return(new WaitForEndOfFrame()); gameOver(gameOverType, false); // Wait a second for the ending animations to play yield return(new WaitForSeconds(1.0f)); guiManager.showGUI(GUIState.EndGame); }
private void SetGameOverCondition(GameOverType condition) { paused = true; m_gameOver = condition; Debug.LogFormat("GAME OVER!! {0}", m_gameOver); for (int i = 0; i < m_allEntities.Count; ++i) { m_allEntities[i].OnGameOver(m_gameOver); } StartCoroutine(GameOverSequence()); }
public void GameOver(GameOverType gameOverType) { if (!isSliding && gameOverType != GameOverType.Pit) { playerAnimation.GameOver(gameOverType); } // ensure the player returns to their original color ActivatePowerUp(powerUpManager.GetActivePowerUp(), false); collisionParticleSystem.transform.parent = null; gameManager.OnPauseGame -= GamePaused; // let the character fall if they are still in the air jumpSpeed = 0; enabled = InAir(); }
public void gameOver(GameOverType gameOverType) { thisAnimation.Stop("Run"); if (gameOverType != GameOverType.Quit) { if (gameOverType == GameOverType.JumpObstacle) { thisAnimation.Play("ForwardDeath"); } else { thisAnimation.Play("BackwardDeath"); } } }
private void OnGameOver(GameOverType gameOverType) { Debug.Log("OnGameOver"); _pauseAndSettingsMediator.ViewVisible = false; _gameOverPanelMediator.ViewVisible = true; _mainMenuMediator.ViewVisible = false; _inGameGuiMediator.ViewVisible = false; if (gameOverType == GameOverType.Win) { _gameOverPanelMediator.SetToWin(); } else if (gameOverType == GameOverType.Lose) { _gameOverPanelMediator.SetToGameOver(); } }
// Token: 0x0600170F RID: 5903 RVA: 0x000C2A54 File Offset: 0x000C0C54 private void UpdateSubtitle() { StudentScript component = this.Yandere.Senpai.GetComponent <StudentScript>(); if (!component.Teacher && this.Yandere.Noticed) { this.Subtitle.color = new Color(this.Subtitle.color.r, this.Subtitle.color.g, this.Subtitle.color.b, 1f); GameOverType gameOverCause = component.GameOverCause; int num = 0; if (gameOverCause == GameOverType.Stalking) { num = 4; } else if (gameOverCause == GameOverType.Insanity) { num = 3; } else if (gameOverCause == GameOverType.Weapon) { num = 1; } else if (gameOverCause == GameOverType.Murder) { num = 5; } else if (gameOverCause == GameOverType.Blood) { num = 2; } else if (gameOverCause == GameOverType.Lewd) { num = 6; } this.Subtitle.text = this.NoticedLines[num]; this.Subtitle.GetComponent <AudioSource>().clip = this.NoticedClips[num]; this.Subtitle.GetComponent <AudioSource>().Play(); return; } if (this.Headmaster) { this.Subtitle.color = new Color(this.Subtitle.color.r, this.Subtitle.color.g, this.Subtitle.color.b, 1f); this.Subtitle.text = this.NoticedLines[8]; this.Subtitle.GetComponent <AudioSource>().clip = this.NoticedClips[8]; this.Subtitle.GetComponent <AudioSource>().Play(); } }
public void SetSprite(GameOverType type) { switch (type) { case GameOverType.FinishWithoutBook: { Renderer.sprite = NoBook; break; } case GameOverType.HitByCar: { Renderer.sprite = CarHit; break; } case GameOverType.Timer: { Renderer.sprite = Timer; break; } case GameOverType.Success: { Renderer.sprite = Success; break; } case GameOverType.HitByBiker: { Renderer.sprite = BycicleHit; break; } case GameOverType.HitByCat: { Renderer.sprite = CatHit; break; } case GameOverType.HitByPidgeon: { Renderer.sprite = PidgeonHit; break; } default: { Renderer.sprite = Success; break; } } }
public void GameOver(GameOverType gameOverType, bool waitForFrame) { if (!gameActive && waitForFrame) { return; } gameActive = false; if (waitForFrame) { // mecanim doesn't trigger the event if we wait until the frame is over playerController.GameOver(gameOverType); StartCoroutine(WaitForFrameGameOver(gameOverType)); } else { inputController.GameOver(); // Mission Manager's gameOver must be called before the Data Manager's gameOver so the Data Manager can grab the // score multiplier from the Mission Manager to determine the final score missionManager.GameOver(); coinGUICollection.GameOver(); // Only call game over on the DataManager if there is no chance a revive is going to happen. We don't want to forget // the values stored in the data manager if a revive does happen if (!allowRevives || !dataManager.CanRevive() || !dataManager.CanPurchaseRevive()) { dataManager.GameOver(); } if (playerController.enabled) { playerController.GameOver(gameOverType); } if (chaseController != null) { chaseController.GameOver(gameOverType); } audioManager.PlayBackgroundMusic(false); if (gameOverType != GameOverType.Quit) { audioManager.PlaySoundEffect(SoundEffects.GameOverSoundEffect); } guiManager.GameOver(); cameraController.GameOver(gameOverType); } }
public void GameOver(GameOverType state) { Debug.Log($"Player {_owner.Id} game over state: {state}"); switch (state) { case GameOverType.Win: _owner.Bird.PlayWinAudio(); break; case GameOverType.Loss: _owner.Bird.PlayLossAudio(); break; case GameOverType.TimerUp: _owner.Bird.PlayLossAudio(); break; } _gameOverState = state; }
// Game over may be called from a trigger so wait for the physics loop to end private IEnumerator WaitForFrameGameOver(GameOverType gameOverType) { yield return(new WaitForEndOfFrame()); GameOver(gameOverType, false); // Wait a second for the ending animations to play yield return(new WaitForSeconds(1.0f)); // Show the revive panel if respawns are enabled if (allowRevives && dataManager.CanRevive() && dataManager.CanPurchaseRevive()) { guiManager.ShowGUI(GUIState.Revive); } else { guiManager.ShowGUI(GUIState.EndGame); } }
public void OnGameOver(GameOverType gameOverType) { if (m_opController != null) { m_opController.OnGameOver(gameOverType); } if (m_mapController != null) { m_mapController.OnGameOver(gameOverType); } if (m_cameraController != null) { m_cameraController.OnGameOver(gameOverType); } GameApp.UI.CloseView(ViewName.GameViewModule); GameApp.UI.OpenView(ViewName.GameOverViewModule, gameOverType); m_state = State.GameOver; }
public void GameOver(GameOverType gameOverType) { if (!useMecanim) { thisAnimation.Stop(runAnimationName); } if (gameOverType != GameOverType.Quit) { if (gameOverType == GameOverType.JumpObstacle) { if (useMecanim) { thisAnimator.SetBool(forwardDeathAnimationName, true); } else { thisAnimation.Play(forwardDeathAnimationName); } } else { if (useMecanim) { thisAnimator.SetBool(backwardDeathAnimationName, true); } else { thisAnimation.Play(backwardDeathAnimationName); } } } }
// Game over may be called from a trigger so wait for the physics loop to end private IEnumerator WaitForFrameGameOver(GameOverType gameOverType) { yield return new WaitForEndOfFrame(); GameOver(gameOverType, false); // Wait a second for the ending animations to play yield return new WaitForSeconds(1.0f); // Show the revive panel if respawns are enabled if (allowRevives && dataManager.CanRevive() && dataManager.CanPurchaseRevive()) { guiManager.ShowGUI(GUIState.Revive); } else { guiManager.ShowGUI(GUIState.EndGame); } }
public void GameOver(GameOverType gameOverType, bool waitForFrame) { if (!gameActive && waitForFrame) return; gameActive = false; if (waitForFrame) { // mecanim doesn't trigger the event if we wait until the frame is over playerController.GameOver(gameOverType); StartCoroutine(WaitForFrameGameOver(gameOverType)); } else { inputController.GameOver(); // Mission Manager's gameOver must be called before the Data Manager's gameOver so the Data Manager can grab the // score multiplier from the Mission Manager to determine the final score missionManager.GameOver(); coinGUICollection.GameOver(); // Only call game over on the DataManager if there is no chance a revive is going to happen. We don't want to forget // the values stored in the data manager if a revive does happen if (!allowRevives || !dataManager.CanRevive() || !dataManager.CanPurchaseRevive()) dataManager.GameOver(); if (playerController.enabled) playerController.GameOver(gameOverType); if (chaseController != null) chaseController.GameOver(gameOverType); audioManager.PlayBackgroundMusic(false); if (gameOverType != GameOverType.Quit) audioManager.PlaySoundEffect(SoundEffects.GameOverSoundEffect); guiManager.GameOver(); cameraController.GameOver(gameOverType); } }
public void gameOver(GameOverType gameOverType) { #if !UNITY_3_5 if (!useMecanim) { #endif thisAnimation.Stop(runAnimationName); #if !UNITY_3_5 } #endif if (gameOverType != GameOverType.Quit) { if (gameOverType == GameOverType.JumpObstacle) { #if !UNITY_3_5 if (useMecanim) { StartCoroutine(playOnce(forwardDeathAnimationName)); } else { #endif thisAnimation.Play(forwardDeathAnimationName); #if !UNITY_3_5 } #endif } else { #if !UNITY_3_5 if (useMecanim) { StartCoroutine(playOnce(backwardDeathAnimationName)); } else { #endif thisAnimation.Play(backwardDeathAnimationName); #if !UNITY_3_5 } #endif } } }
public void gameOver(GameOverType gameOverType) { if (!isSliding && gameOverType != GameOverType.Pit) playerAnimation.gameOver(gameOverType); // ensure the player returns to their original color activatePowerUp(powerUpManager.getActivePowerUp(), false); collisionParticleSystem.transform.parent = null; gameManager.onPauseGame -= gamePaused; // let the character fall if they are still in the air jumpSpeed = 0; enabled = inAir(); }
public void GameOver(GameOverType type) { State = GameState.GameOver; GUIManager.Instance.UnactivatePauseButton(); _playerManager.OnGameOver(); //播放一些动画 switch (type) { case GameOverType.Obstacle: { break; } case GameOverType.OutOfEdge: { break; } } ScoreManager.Instance.AddScoreToRecord(Distance); //停止滚动然后显示得分菜单 StartCoroutine(GameGenerator.Instance.StopScrollingAndShowEnd(2.0f)); }
void Awake() { Instance = this; m_allEntities = new List<Entity>(); m_activeEnemies = new List<Enemy>(); m_activeNPCs = new List<NPC>(); m_player = null; m_spawners = new List<EnemySpawner>(FindObjectsOfType<EnemySpawner>()); m_gameOver = GameOverType.None; m_gameOverScreen = FindObjectOfType<GameOver>(); if (m_gameOverScreen != null) { m_gameOverScreen.gameObject.SetActive(false); } m_killedCreatureCount = m_killedNPCCount = 0; m_spawnedCreatures = m_spawnedNPCCount = 0; m_elapsed = 0.0f; m_boundaries = new Rect(); Camera cam = Camera.main; float camHHeight = cam.orthographicSize; float camHWidth = camHHeight * cam.aspect; cam.transform.position.Set(0,0,cam.transform.position.z); m_boundaries.x = -camHWidth; m_boundaries.width = camHWidth * 2; m_boundaries.y = 2 * camHHeight; m_boundaries.height = camHHeight * 4; // At the moment there are two areas on top of each other }
// Game over may be called from a trigger so wait for the physics loop to end private IEnumerator waitForFrameGameOver(GameOverType gameOverType) { yield return new WaitForEndOfFrame(); gameOver(gameOverType, false); // Wait a second for the ending animations to play yield return new WaitForSeconds(1.0f); guiManager.showGUI(GUIState.EndGame); }
public void gameOver(GameOverType gameOverType, bool waitForFrame) { if (!gameActive && waitForFrame) return; gameActive = false; if (waitForFrame) { // mecanim doesn't trigger the event if we wait until the frame is over playerController.gameOver(gameOverType); StartCoroutine(waitForFrameGameOver(gameOverType)); } else { inputController.gameOver(); // Mission Manager's gameOver must be called before the Data Manager's gameOver so the Data Manager can grab the // score multiplier from the Mission Manager to determine the final score missionManager.gameOver(); coinGUICollection.gameOver(); dataManager.gameOver(); if (playerController.enabled) playerController.gameOver(gameOverType); if (chaseController != null) chaseController.gameOver(gameOverType); audioManager.playBackgroundMusic(false); if (gameOverType != GameOverType.Quit) audioManager.playSoundEffect(SoundEffects.GameOverSoundEffect); guiManager.gameOver(); cameraController.gameOver(gameOverType); } }
public void OnGameOver(GameOverType gameoverType) { m_body.velocity = Vector2.zero; }
public void gameOver(GameOverType gameOverType) { gameActive = false; GameManager.instance.onPauseGame -= gamePaused; }