Пример #1
0
    void Update()
    {
        PlayerInput.SimulateKeyPress();

        if (Cursor.lockState != CursorLockMode.Locked)
        {
            Cursor.lockState = CursorLockMode.Locked;
        }

        if (SceneManager.GetActiveScene().name != OVERWORLDLEVEL || _shrineName.color.a <= 0)
        {
            ShowShrineName();
        }

        switch (_state)
        {
        case State.None:
            break;

        case State.Gameplay:
            if (_playerScript.EnterCinematic)
            {
                _state = State.Cinematic;
                Transform trigger = _playerScript.GetCinematicTrigger;
                if (!trigger)
                {
                    trigger = transform;
                }
                if (_playerScript.StartTeleport)
                {
                    trigger = _player;
                }
                _cinematic = trigger.GetComponent <Cinematic>();
                _cinematic.Begin();
                _playerScript.ControlCar = false;
            }
            break;

        case State.Cinematic:
            if (_cinematic.End)
            {
                _state = State.Gameplay;
                _playerScript.ControlCar     = true;
                _playerScript.EnterCinematic = false;
            }
            break;
        }
    }