Пример #1
0
    private void Awake()
    {
        Player_Starship_Controller psc = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Starship_Controller>();

        psc.OnMouseOver    += OnMouseOv;
        psc.OnMouseOverEnd += OnMouseOverEnd;
        starshipRotTr       = psc.GetComponent <Starship>().RotationPoint;
    }
Пример #2
0
    private void Awake()
    {
        GameManager.Initialize();

        GameText.DeactivateEvent();
        GameText.SetInGameTextNowEvent(textAsset);

        playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Starship_Controller>();
        playerCamera     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Player_Camera_Controller>();

        PlayerStarshipTr = playerController.transform;
    }
Пример #3
0
    private void Awake()
    {
        GameManager.Initialize();
        SceneController.LoadAdditiveScene(sceneLocationName);

        GameText.DeactivateEvent();
        GameText.SetInGameTextNowEvent(textAsset);

        playerCamera     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Player_Camera_Controller>();
        playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Starship_Controller>();
        playerController.GetComponent <Health>().OnDeath += RestartGame;
    }
Пример #4
0
 void Awake()
 {
     player_Controller = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Starship_Controller>();
     PlayerStarshipTr  = player_Controller.transform;
     mainCamera        = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Player_Camera_Controller>();
     disabledTargets   = targets.Length;
     playerTrigger.OnPlayerStarshipEnter += StartTarget;
     for (int i = 0; i < targets.Length; ++i)
     {
         targets[i].TargetEvent = TargetHit;
     }
 }
Пример #5
0
    private void Awake()
    {
        GameManager.Initialize();

        SceneController.LoadAdditiveScene(sceneLocationName);
        GameText.DeactivateEvent();
        GameText.SetInGameTextNowEvent(textAsset);

        playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Starship_Controller>();
        playerCamera     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Player_Camera_Controller>();
        playerStarship   = playerController.GetComponent <Starship>();
        playerController.GetComponent <Health>().OnDeath += OnPlayerDeath;
        systemStarships = GetComponent <System_Starships>();

        PlayerStarshipTr = playerController.transform;

        EndTrigger.OnPlayerStarshipEnter += PlayerStarshipEnterEndTrigger;
    }
Пример #6
0
    private void Awake()
    {
        GameManager.Initialize();

        player_Camera_Controller   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Player_Camera_Controller>();
        player_Starship_Controller = GameObject.FindGameObjectWithTag("Player").GetComponentInParent <Player_Starship_Controller>();
        playerStarship             = player_Starship_Controller.GetComponent <Starship>();
        player_Starship_Controller.GetComponent <Health>().OnDeath += Restart;

        GameText.DeactivateEvent();
        GameText.SetInGameTextNowEvent(textAsset);

        GameAudio.StartAudioEvent(audioClip, 0.7f, true);
        if (StaticSettings.isRestart)
        {
            isRestart = true;
            StaticSettings.isRestart = false;
        }

        EndTrigger.OnPlayerStarshipEnter += OnPlayerStarshipEnterEndTrigger;
    }
Пример #7
0
    private IEnumerator IStartLift(Player_Starship_Controller player_Starship_Controller, Method OnLiftArrived)
    {
        Transform pos, rot;

        player_Starship_Controller.GetPositionAndRotationTransforms(out pos, out rot);
        while (Quaternion.Angle(starshipTargetTr.rotation, rot.rotation) > 0.2f || Vector3.Distance(starshipTargetTr.position, pos.position) > 0.01f)
        {
            pos.position = Vector3.MoveTowards(pos.position, starshipTargetTr.position, Time.deltaTime * starshipMoveSpeed);
            rot.rotation = Quaternion.RotateTowards(rot.rotation, starshipTargetTr.rotation, Time.deltaTime * starshipRotateSpeed);
            yield return(null);
        }

        while (Vector3.Distance(liftTr.position, liftEndTr.position) > 0.01f)
        {
            liftTr.position = Vector3.MoveTowards(liftTr.position, liftEndTr.position, Time.deltaTime * LiftMoveSpeed);
            pos.position    = starshipTargetTr.position;
            yield return(null);
        }
        liftTr.position = liftEndTr.position;
        OnLiftArrived?.Invoke();
    }
Пример #8
0
    private void Awake()
    {
        GameManager.Initialize();

        SceneController.LoadAdditiveScene(sceneLocation);
        GameText.DeactivateEvent();
        GameText.SetInGameTextNowEvent(textAsset);

        systemStarships = GetComponent <System_Starships>();

        playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Starship_Controller>();
        playerCamera     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Player_Camera_Controller>();
        playerStarship   = playerController.GetComponent <Starship>();
        playerController.GetComponent <Health>().OnDeath += OnPlayerDeath;

        systemStarships.StarshipsTeams.Add(new System_Starships.StarshipsTeam(playerStarship.GetComponent <Starship>()));
        systemStarships.StarshipsTeams.Add(new System_Starships.StarshipsTeam());

        playerCamera.SetPositionWithOffset(playerController.transform.position);
        screenDark.SetDark(false);
        playerController.SetLockControl(true);
    }
Пример #9
0
 internal void StartLift(Player_Starship_Controller player_Starship_Controller, Method OnLiftArrived) => StartCoroutine(IStartLift(player_Starship_Controller, OnLiftArrived));