Ejemplo n.º 1
0
    private IEnumerator Start()
    {
        systemStarships.InitializeStarshipsTeams(GetComponent <StarshipsSpawnMover>().MoveStarshipsOnSpawns());

        GameAudio.StartAudioEvent(audioClip, 0.125f, true);
        if (!StaticSettings.isRestart)
        {
            playerController.SetLockControl(true);
            playerCamera.SetLockMove(false);
            systemStarships.SetStarshipsLock(true);

            MoverStartPlayer.ToStartPosition(playerStarship);

            playerCamera.SetPositionWithOffset(PlayerStarshipTr.position);

            playerController.SetActiveCanvas(false);

            MoverStartZ2.Move(Z2Starship);

            Z5_Scene.SetActive(true);
            Z2_Scene.SetActive(true);
            Z5animator.SetFloat("Part(speed)", 1);

            yield return(MoverStartPlayer.IStarshipMove(playerStarship));


            cruiserAttack.StartAim();

            Z5Image.SetActive(true);
            Z2Image.SetActive(true);


            playerCamera.EnableTargetMove(cameraTarget);

            GameDialogs.StartDialogEvent(OnStartDialogEnd);
            GameDialogs.OnNextDialog += OnNextDialog;
        }
        else
        {
            GameGoals.SetActiveGoalEvent(true);

            StaticSettings.isRestart = false;

            systemStarships.SetStarshipsLock(false);

            MoverStartPlayer.ToEndPosition(playerStarship);
            MoverStartZ2.ToEndPosition(Z2Starship);

            Z2StarshipAI.SetTargetToFollowWithMaxDistance(PlayerStarshipTr);

            systemStarships.SetStarshipsFollowEnemy(true);

            cruiserAttack.StartAim();

            FrigateHealth.SetActive(true);

            cruiserAttack.StartAttack(OnBattleEnd);
            isBattle = true;
        }
    }
Ejemplo n.º 2
0
 private void StartGame()
 {
     GameGoals.SetActiveGoalEvent(true);
     GameDialogs.ShowInGameDialogEvent(0);
     systemStarships.SetStarshipsLock(1, true);
     SetGameStop(false);
 }
Ejemplo n.º 3
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;
    }
Ejemplo n.º 4
0
    private void Start()
    {
        MStart();
        Checkpoint(StaticSettings.checkpointID);

        if (!isRestart && StaticSettings.checkpointID == 0)
        {
            player_Starship_Controller.SetLockControl(true);
            player_Starship_Controller.SetActiveCanvas(false);
            player_Camera_Controller.SetPositionWithOffset(MoverStart.GetEndPosition());

            MoverStart.Move(playerStarship);

            GameDialogs.StartDialogEvent(EndDialogEvent);
        }
        else
        {
            isRestart = false;
            GameGoals.SetActiveGoalEvent(true);
            if (StaticSettings.checkpointID == 0)
            {
                MoverStart.ToEndPosition(playerStarship);
            }
        }
    }
Ejemplo n.º 5
0
 private void EndDialogEvent()
 {
     GameGoals.SetActiveGoalEvent(true);
     player_Starship_Controller.SetLockControl(false);
     player_Starship_Controller.SetActiveCanvas(true);
     player_Camera_Controller.SetLockMove(false);
     MoverStart.StopMove();
 }
Ejemplo n.º 6
0
    private IEnumerator IRestart()
    {
        SetGameStop(true);
        GameGoals.SetActiveGoalEvent(true);
        system_Race.ShowTimer();
        yield return(GameFreezeTime.IFreezeTimeEvent());

        system_Race.StartRace(End);
        SetGameStop(false);
    }
Ejemplo n.º 7
0
    private void DoCheckpoint3()
    {
        Checkpoint3Trigger.OnPlayerStarshipEnter -= DoCheckpoint3;

        Dialog6Trigger.OnPlayerStarshipEnter += Dialog6;

        physicButton.OnButtonPushed += OnButtonPushed;

        GameGoals.ShowGoalEvent(5);

        SetCheckpoint(3);
    }
Ejemplo n.º 8
0
    protected override void Checkpoint(int checkpointID)
    {
        switch (checkpointID)
        {
        case 0:
            Checkpoint1Trigger.OnPlayerStarshipEnter += DoCheckpoint1;
            Targets.OnStart += OnTargets;
            Targets.OnEnd   += OnTargetsEnd;
            break;

        case 1:
            GameGoals.ShowGoalEvent(2);

            MovePlayerToCheckpoint(CheckpointTr1);
            player_Camera_Controller.SetPositionWithOffset(CheckpointTr1.position);

            Checkpoint2Trigger.OnPlayerStarshipEnter += DoCheckpoint2;
            Arena.OnStart += OnArenaStart;
            Arena.OnEnd   += OnArenaEnd;

            break;

        case 2:
            GameGoals.ShowGoalEvent(4);

            MovePlayerToCheckpoint(CheckpointTr2);
            player_Camera_Controller.SetPositionWithOffset(CheckpointTr2.position);

            Dialog4Trigger.OnPlayerStarshipEnter     += Dialog4;
            Dialog5Trigger.OnPlayerStarshipEnter     += Dialog5;
            Checkpoint3Trigger.OnPlayerStarshipEnter += DoCheckpoint3;

            break;

        case 3:
            GameGoals.ShowGoalEvent(5);
            MovePlayerToCheckpoint(CheckpointTr3);
            player_Camera_Controller.SetPositionWithOffset(CheckpointTr3.position);

            Dialog6Trigger.OnPlayerStarshipEnter += Dialog6;

            physicButton.OnButtonPushed += OnButtonPushed;
            break;

        case 4:
            OnButtonPushed();
            MovePlayerToCheckpoint(CheckpointTr4);
            player_Camera_Controller.SetPositionWithOffset(CheckpointTr4.position);
            break;
        }
    }
Ejemplo n.º 9
0
    private void OnButtonPushed()
    {
        Dialog5Trigger.OnPlayerStarshipEnter -= Dialog5;
        physicButton.OnButtonPushed          -= OnButtonPushed;

        Dialog7Trigger.OnPlayerStarshipEnter += Dialog7;

        EndDoor.Move();
        EnemiesActivator.SetActiveGameObjects(true);
        colorChanger.ChangeEmissionColor(newEmissionLightColor);
        GameGoals.ShowGoalEvent(6);

        SetCheckpoint(4);
    }
Ejemplo n.º 10
0
 private void OnStartDialogEnd()
 {
     Z2Image.SetActive(false);
     Z5Image.SetActive(false);
     Z2_Scene.SetActive(false);
     Z5_Scene.SetActive(false);
     playerController.SetActiveCanvas(true);
     playerCamera.DisableTargetMove();
     Z2StarshipAI.SetTargetToFollowWithMaxDistance(PlayerStarshipTr);
     GameGoals.SetActiveGoalEvent(true);
     playerController.SetLockControl(false);
     systemStarships.StarshipsTeams[1].SetFollowTarget(PlayerStarshipTr);
     systemStarships.SetStarshipsLock(false);
     systemStarships.SetStarshipsFollowEnemy(true);
     isBattle = true;
 }
Ejemplo n.º 11
0
    private IEnumerator Start()
    {
        systemStarships.InitializeStarshipsTeams(GetComponent <StarshipsSpawnMover>().MoveStarshipsOnSpawns());

        systemStarships.OnOneTeamLeft += OnOneTeamLeft;

        GameAudio.StartAudioEvent(audioClip, 0.4f, true);
        if (!StaticSettings.isRestart)
        {
            playerController.SetLockControl(true);
            playerCamera.SetLockMove(false);
            systemStarships.SetStarshipsLock(true);

            MoverStart.ToStartPosition(playerStarship);

            playerCamera.SetPositionWithOffset(PlayerStarshipTr.position);

            playerController.SetActiveCanvas(false);

            yield return(MoverStart.IStarshipMove(playerStarship));


            playerCamera.EnableTargetMove(cameraTarget);

            GameDialogs.StartDialogEvent(OnStartDialogEnd);
            GameDialogs.OnNextDialog += OnNextDialog;
        }
        else
        {
            GameGoals.SetActiveGoalEvent(true);

            StaticSettings.isRestart = false;

            systemStarships.SetStarshipsLock(false);

            MoverStart.ToEndPosition(playerStarship);

            Z2StarshipAI.SetTargetToFollowWithMaxDistance(PlayerStarshipTr);

            systemStarships.StarshipsTeams[1].SetFollowTarget(PlayerStarshipTr);

            systemStarships.SetStarshipsFollowEnemy(true);

            isBattle = true;
        }
    }
Ejemplo n.º 12
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;
                 }
             }
         }
     }
 }
Ejemplo n.º 13
0
 protected override void StartGame()
 {
     GameGoals.SetActiveGoalEvent(true);
     SetGameStop(false);
 }
Ejemplo n.º 14
0
 protected override void MRestart()
 {
     GameGoals.SetActiveGoalEvent(true);
     systemStarships.SetStarshipsLock(false);
 }
Ejemplo n.º 15
0
 private void OnArenaStart()
 {
     Arena.OnStart -= OnArenaStart;
     GameDialogs.ShowInGameDialogEvent(2);
     GameGoals.ShowGoalEvent(3);
 }
Ejemplo n.º 16
0
 private void OnTargetsEnd()
 {
     Targets.OnEnd -= OnTargetsEnd;
     GameDialogs.ShowInGameDialogEvent(1);
     GameGoals.ShowGoalEvent(2);
 }
Ejemplo n.º 17
0
 private void OnArenaEnd()
 {
     Arena.OnEnd -= OnArenaEnd;
     GameDialogs.ShowInGameDialogEvent(3);
     GameGoals.ShowGoalEvent(4);
 }
Ejemplo n.º 18
0
 protected override void StartGame()
 {
     GameGoals.SetActiveGoalEvent(true);
     system_Race.StartRace(End);
     SetGameStop(false);
 }
Ejemplo n.º 19
0
 private void Dialog5()
 {
     Dialog5Trigger.OnPlayerStarshipEnter -= Dialog5;
     GameDialogs.ShowInGameDialogEvent(5);
     GameGoals.ShowGoalEvent(5);
 }
Ejemplo n.º 20
0
 private void OnTargets()
 {
     Targets.OnStart -= OnTargets;
     GameDialogs.ShowInGameDialogEvent(0);
     GameGoals.ShowGoalEvent(1);
 }
Ejemplo n.º 21
0
 protected override void StartGame()
 {
     GameGoals.SetActiveGoalEvent(true);
     system_TimeRace.Activate(RestartGame, EndGame);
     SetGameStop(false);
 }