private void FixedUpdate() { if (isShowedSlide && isBattle && !isPlayerDead) { time += Time.fixedDeltaTime; if (!isShowDialog1 && time > timeToIngameDialog1) { isShowDialog1 = true; GameDialogs.ShowInGameDialogEvent(0); } if (!isShowDialog2 && time > timeToIngameDialog2) { isShowDialog2 = true; GameDialogs.ShowInGameDialogEvent(1); } timeToWave += Time.fixedDeltaTime; if (timeToWave > wavesTimeInterval) { wavesTimeInterval *= 1.02f; timeToWave = 0; StopAllCoroutines(); StartCoroutine(IWave()); } } }
private void Start() { systemStarships.InitializeStarshipsTeams(GetComponent <StarshipsSpawnMover>().MoveStarshipsOnSpawns()); GameAudio.StartAudioEvent(audioClip, 0.4f, true); if (!StaticSettings.isRestart) { SetGameStop(true); GameDialogs.StartDialogEvent(StartGame); } else { GameGoals.SetActiveGoalEvent(true); StaticSettings.isRestart = false; systemStarships.SetStarshipsLock(false); systemStarships.SetStarshipsLock(1, true); GameDialogs.ShowInGameDialogEvent(0); } systemStarships.SetStarshipsActive(2, false); systemStarships.SetStarshipsLock(2, true); systemStarships.SetStarshipsActive(3, false); systemStarships.SetStarshipsLock(3, true); systemStarships.StarshipsTeams[1].OnTeamDevastated += FirstWaveDead; systemStarships.StarshipsTeams[2].OnTeamDevastated += SecondWaveDead; }
private void StartGame() { GameGoals.SetActiveGoalEvent(true); GameDialogs.ShowInGameDialogEvent(0); systemStarships.SetStarshipsLock(1, true); SetGameStop(false); }
private IEnumerator IWaited() { isWaited = true; yield return(GameDialogs.IShowInGameDialogEvent(5)); isWaitedSayed = true; if (isWaitingToAnswer) { GameDialogs.ShowInGameDialogEvent(1); } }
private void OnCollisionEnter(Collision collision) { if (bulletsCount < bulletsCountOn2 && collision.gameObject.CompareTag("Bullet") && collision.gameObject.GetComponent <Bullet>().GetBulletType() == Bullet.BulletType.Player) { bulletsCount += 1; if (bulletsCountOn1 == bulletsCount) { GameDialogs.ShowInGameDialogEvent(inGameDialogId1); } if (bulletsCountOn2 == bulletsCount) { GameDialogs.ShowInGameDialogEvent(inGameDialogId2); } } }
private void FixedUpdate() { if (!isEnd) { if (Input.GetKey(KeyCode.N)) { EndGame(); } if (!isPlayerDead) { if (!isBattle) { if (systemStarships.GetMinDistanceTeamToPoint(0, BattleTr.position) < distanceBattle) { isBattle = true; systemStarships.SetStarshipsLock(1, false); systemStarships.SetStarshipsFollowEnemy(0, true); GameGoals.ShowGoalEvent(1); GameDialogs.ShowInGameDialogEvent(1); } } else if (!isDisqualified) { if (Vector3.Distance(PlayerStarshipTr.position, BattleTr.position) > distanceDisqualification) { timeOut += Time.fixedDeltaTime; if (!isShowedText) { isShowedText = true; GameDialogs.ShowInGameDialogEvent(4); } if (timeOut > timeDisqualification) { StartCoroutine(IDisqualificate()); } } else { isShowedText = false; timeOut = 0; } } } } }
private void FixedUpdate() { if (!isEnd) { if (Input.GetKey(KeyCode.N)) { EndGame(); } if (!isPlayerDead) { if (isBattle && !isSayed && Vector3.Distance(PlayerStarshipTr.position, Z2StarshipAI.transform.position) < 5f) { isSayed = true; GameDialogs.ShowInGameDialogEvent(1); } } } }
private IEnumerator IDisqualificate() { isDisqualified = true; yield return(GameDialogs.IShowInGameDialogEvent(5)); int team = systemStarships.StarshipChangeTeamToNew(C07Starship, 0); systemStarships.StarshipChangeTeam(PlayerStarship, 0, team); C07Health.SetInvincible(false); C07Starship.SetFollowTarget(PlayerStarshipTr); systemStarships.StarshipsTeams[0].SetFollowTarget(PlayerStarshipTr); if (isShowedDialog2) { GameDialogs.ShowInGameDialogEvent(3); } else { GameDialogs.ShowInGameDialogEvent(7); } }
private IEnumerator IShowDialog() { if (Wait != null) { StopCoroutine(Wait); } if (!isWaited) { if (!isWaited1) { yield return(GameDialogs.IShowInGameDialogEvent(1)); Wait = IWait1(); } else if (!isWaited2) { yield return(GameDialogs.IShowInGameDialogEvent(1)); Wait = IWait2(); } else if (!isWaited3) { isWaitingToAnswer = true; Wait = IWait3(); } StartCoroutine(Wait); } else { if (isWaitedSayed) { GameDialogs.ShowInGameDialogEvent(1); } else { isWaitingToAnswer = true; } } }
private void ShowDialog1() { Dialog1Trigger.OnPlayerStarshipEnter -= ShowDialog1; GameDialogs.ShowInGameDialogEvent(1); }
private void ShowDialog0() { Dialog0Trigger.OnPlayerStarshipEnter -= ShowDialog0; GameDialogs.ShowInGameDialogEvent(0); }
private void OnArenaStart() { Arena.OnStart -= OnArenaStart; GameDialogs.ShowInGameDialogEvent(2); GameGoals.ShowGoalEvent(3); }
private void Dialog5() { Dialog5Trigger.OnPlayerStarshipEnter -= Dialog5; GameDialogs.ShowInGameDialogEvent(5); GameGoals.ShowGoalEvent(5); }
private void OnTargetsEnd() { Targets.OnEnd -= OnTargetsEnd; GameDialogs.ShowInGameDialogEvent(1); GameGoals.ShowGoalEvent(2); }
private void EndDialog() => GameDialogs.ShowInGameDialogEvent(1);
private void OnArenaEnd() { Arena.OnEnd -= OnArenaEnd; GameDialogs.ShowInGameDialogEvent(3); GameGoals.ShowGoalEvent(4); }
private void Dialog7() { Dialog7Trigger.OnPlayerStarshipEnter -= Dialog7; GameDialogs.ShowInGameDialogEvent(7); }
private void Dialog6() { Dialog6Trigger.OnPlayerStarshipEnter -= Dialog6; GameDialogs.ShowInGameDialogEvent(6); }
private void ShowDialog2() { Dialog2Trigger.OnPlayerStarshipEnter -= ShowDialog2; GameDialogs.ShowInGameDialogEvent(2); }
private void ShowDialog3() { Dialog3Trigger.OnPlayerStarshipEnter -= ShowDialog3; GameDialogs.ShowInGameDialogEvent(3); }
private void C07Health_OnDeath() { GameDialogs.ShowInGameDialogEvent(6); }
private void OnTargets() { Targets.OnStart -= OnTargets; GameDialogs.ShowInGameDialogEvent(0); GameGoals.ShowGoalEvent(1); }
private void Dialog4() { Dialog4Trigger.OnPlayerStarshipEnter -= Dialog4; GameDialogs.ShowInGameDialogEvent(4); }