示例#1
0
 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());
         }
     }
 }
示例#2
0
    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;
    }
示例#3
0
 private void StartGame()
 {
     GameGoals.SetActiveGoalEvent(true);
     GameDialogs.ShowInGameDialogEvent(0);
     systemStarships.SetStarshipsLock(1, true);
     SetGameStop(false);
 }
示例#4
0
    private IEnumerator IWaited()
    {
        isWaited = true;
        yield return(GameDialogs.IShowInGameDialogEvent(5));

        isWaitedSayed = true;
        if (isWaitingToAnswer)
        {
            GameDialogs.ShowInGameDialogEvent(1);
        }
    }
示例#5
0
 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);
         }
     }
 }
示例#6
0
 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;
                 }
             }
         }
     }
 }
示例#7
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);
             }
         }
     }
 }
示例#8
0
    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);
        }
    }
示例#9
0
    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;
            }
        }
    }
示例#10
0
 private void ShowDialog1()
 {
     Dialog1Trigger.OnPlayerStarshipEnter -= ShowDialog1;
     GameDialogs.ShowInGameDialogEvent(1);
 }
示例#11
0
 private void ShowDialog0()
 {
     Dialog0Trigger.OnPlayerStarshipEnter -= ShowDialog0;
     GameDialogs.ShowInGameDialogEvent(0);
 }
示例#12
0
 private void OnArenaStart()
 {
     Arena.OnStart -= OnArenaStart;
     GameDialogs.ShowInGameDialogEvent(2);
     GameGoals.ShowGoalEvent(3);
 }
示例#13
0
 private void Dialog5()
 {
     Dialog5Trigger.OnPlayerStarshipEnter -= Dialog5;
     GameDialogs.ShowInGameDialogEvent(5);
     GameGoals.ShowGoalEvent(5);
 }
示例#14
0
 private void OnTargetsEnd()
 {
     Targets.OnEnd -= OnTargetsEnd;
     GameDialogs.ShowInGameDialogEvent(1);
     GameGoals.ShowGoalEvent(2);
 }
示例#15
0
 private void EndDialog() => GameDialogs.ShowInGameDialogEvent(1);
示例#16
0
 private void OnArenaEnd()
 {
     Arena.OnEnd -= OnArenaEnd;
     GameDialogs.ShowInGameDialogEvent(3);
     GameGoals.ShowGoalEvent(4);
 }
示例#17
0
 private void Dialog7()
 {
     Dialog7Trigger.OnPlayerStarshipEnter -= Dialog7;
     GameDialogs.ShowInGameDialogEvent(7);
 }
示例#18
0
 private void Dialog6()
 {
     Dialog6Trigger.OnPlayerStarshipEnter -= Dialog6;
     GameDialogs.ShowInGameDialogEvent(6);
 }
示例#19
0
 private void ShowDialog2()
 {
     Dialog2Trigger.OnPlayerStarshipEnter -= ShowDialog2;
     GameDialogs.ShowInGameDialogEvent(2);
 }
示例#20
0
 private void ShowDialog3()
 {
     Dialog3Trigger.OnPlayerStarshipEnter -= ShowDialog3;
     GameDialogs.ShowInGameDialogEvent(3);
 }
示例#21
0
 private void C07Health_OnDeath()
 {
     GameDialogs.ShowInGameDialogEvent(6);
 }
示例#22
0
 private void OnTargets()
 {
     Targets.OnStart -= OnTargets;
     GameDialogs.ShowInGameDialogEvent(0);
     GameGoals.ShowGoalEvent(1);
 }
示例#23
0
 private void Dialog4()
 {
     Dialog4Trigger.OnPlayerStarshipEnter -= Dialog4;
     GameDialogs.ShowInGameDialogEvent(4);
 }