void ShowAndAddBonusScore() { mIsShowScoreBonus = false; UIManager.sSingleton.ShowBonusScore(mBonusScore); if (GameManager.sSingleton.TotalNumOfPlayer() == 2) { int dividedScore = mBonusScore / 2; mPlayerController1.score += dividedScore; mPlayerController2.score += dividedScore; } else if (GameManager.sSingleton.IsThisPlayerActive(1)) { mPlayerController1.score += mBonusScore; } else if (GameManager.sSingleton.IsThisPlayerActive(2)) { mPlayerController2.score += mBonusScore; } if (GameManager.sSingleton.IsThisPlayerActive(1)) { UIManager.sSingleton.UpdateScore(1, mPlayerController1.score); } if (GameManager.sSingleton.IsThisPlayerActive(2)) { UIManager.sSingleton.UpdateScore(2, mPlayerController2.score); } StartCoroutine(CoroutineUtil.WaitFor(5.0f, AfterBossIsDead)); }
void Update() { if (GameManager.sSingleton.currState != GameManager.State.BATTLE) { return; } if (!UIManager.sSingleton.IsPauseGameOverMenu || BombManager.sSingleton.IsPause) { mTimer += Time.deltaTime; if (isAppearBoss && !isBossAppeared) { if (mTimer > meetBossTimeList[GameManager.sSingleton.currStage - 1] && BombManager.sSingleton.dualLinkState != BombManager.DualLinkState.SHOOTING) { isBossAppeared = true; GameManager.sSingleton.currState = GameManager.State.BOSS_MOVE_INTO_SCREEN; // Disable remaining enemies on screen. int count = enemyList.Count; for (int i = 0; i < count; i++) { enemyList[0].GetComponent <EnemyBase>().PlayEnemyDeathPS(); enemyList[0].gameObject.SetActive(false); } EnvObjManager.sSingleton.DisableAllDestroyableObj(); } } if (isAppearEnemy) { AppearEnemyMinion(); } } if (isBossDead && !CoroutineUtil.isCoroutine) { System.Action action = (() => ShowAndAddBonusScore()); if (mIsShowScoreBonus) { StartCoroutine(CoroutineUtil.WaitFor(2.0f, action)); } } }
void Update() { if (currState == State.PLAYER_MOVE_INTO_SCREEN) { if (AudioManager.sSingleton != null) { AudioManager.sSingleton.PlayInGameDialogueBGM(); AudioManager.sSingleton.FadeInBGM(); } isMoveDuringDialogue = false; Vector3 currPos = player1.transform.position; Vector3 toPos = p1DefaultPos.position; float step = plyRespawnYSpd * Time.deltaTime; player1.transform.position = Vector3.MoveTowards(currPos, toPos, step); if (TotalNumOfPlayer() == 2) { currPos = player2.transform.position; toPos = p2DefaultPos.position; player2.transform.position = Vector3.MoveTowards(currPos, toPos, step); } if (player1.transform.position == p1DefaultPos.position || player2.transform.position == p2DefaultPos.position) { if (!CoroutineUtil.isCoroutine) { StartCoroutine(CoroutineUtil.WaitFor(initalWaitAfterIntoScreen, () => { currState = State.TUTORIAL; })); } } } else if (currState == State.BOSS_MOVE_INTO_SCREEN) { Transform boss = EnemyManager.sSingleton.GetEnemyBossTrans(); boss.gameObject.SetActive(true); boss.transform.position = Vector3.MoveTowards(boss.transform.position, bossDefaultPos.position, plyRespawnYSpd * Time.deltaTime * 2.5f); mCurrBoss = boss; isMoveDuringDialogue = true; if (boss.transform.position == bossDefaultPos.position) { if (!CoroutineUtil.isCoroutine) { StartCoroutine(CoroutineUtil.WaitFor(initalWaitAfterIntoScreen, () => { currState = State.DIALOGUE; })); } } } else if (currState == State.DIALOGUE) { if (DialogueManager.sSingleton != null) { DialogueManager.sSingleton.HandleDialogue(); } else if (DialogueManager.sSingleton == null && EnemyManager.sSingleton.isBossAppeared) { SetToBattleState(); } else { currState = State.BATTLE; } } else if (currState == State.BATTLE) { UIManager.sSingleton.ShowAutoCollectZone(); UIManager.sSingleton.ShowStageName(); HandleScoreColor(); if (mP1Controller.state == PlayerController.State.SOUL && mP2Controller != null && mP2Controller.state == PlayerController.State.SOUL) { if (mP1Controller.life > 0) { mP1Controller.MinusLife(); mP1Controller.ReviveSelf(true); mP1ReviveController.ResetSoul(); } if (mP2Controller.life > 0) { mP2Controller.MinusLife(); mP2Controller.ReviveSelf(true); mP2ReviveController.ResetSoul(); } } if (IsDeactivateLinkBar()) { mP1Controller.DisableFlamePS(); if (mP2Controller != null) { mP2Controller.DisableFlamePS(); } UIManager.sSingleton.DeactivateBothLinkBar(); } } else if (currState == State.RESULT) { // TODO: RESET BACK EVERYTHING. isMoveDuringDialogue = false; } else if (currState == State.TUTORIAL) { TutorialManager.sSingleton.SetEnableTutorial(); } }