Exemplo n.º 1
0
    void Start()
    {
        _collider            = GetComponent <Collider>();
        _fpsController       = GetComponent <FPSController>();
        _characterController = GetComponent <CharacterController>();
        _gameSceneManager    = GameSceneManager.instance;

        _aiBodyPartLayer = LayerMask.NameToLayer("AI Body Part");
        _interactiveMask = 1 << LayerMask.NameToLayer("Interactive");

        if (_gameSceneManager != null)
        {
            PlayerInfo info = new PlayerInfo();
            info.camera           = _camera;
            info.characterManager = this;
            info.collider         = _collider;
            info.meleeTrigger     = _meleeTrigger;

            _gameSceneManager.RegisterPlayerInfo(_collider.GetInstanceID(), info);
        }

        //Get rid of mouse cursor
        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;
        if (_playerHUD)
        {
            _playerHUD.Fade(2.0f, ScreenFadeType.FadeIn);
        }
    }