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; } }
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); } } }