Пример #1
0
    private void Start()
    {
        base.Initialized();
        m_sceneCharactersManager.AddPlayerToCharaterList(this.gameObject, CharacterType.Player);
        m_InputKeyManager = GetComponent <InputKeyManager>();

        GunClass[] guns = GetComponentsInChildren <GunClass>();
        m_Guns = new List <GunClass>();
        for (int i = 0; i < guns.Length; i++)
        {
            m_Guns.Add(guns[i]);
        }
        m_currentlyActiveGun = m_Guns[0];

        if (m_MainCameraTransform == null)
        {
            m_MainCameraTransform = Camera.main.transform;
        }

        m_simpleLocomotionState = new PlayerSimpleLocomotionState(this, m_animator);
        m_gunFireState          = new PlayerGunFiringState(this, m_animator);

        if (m_typeOfCameraMovement == CameraMovementType.FreeLook)
        {
            OnStateChanged(m_simpleLocomotionState);
        }
        else
        {
            OnStateChanged(m_gunFireState);
        }
    }
Пример #2
0
 public void Start()
 {
     _player      = player.GetInstance();
     _playerState = player.GetInstance().curState;
     Mgr          = InputKeyManager.GetInstance();
 }
Пример #3
0
 private void Awake()
 {
     instance = this;
 }
Пример #4
0
 private void Start()
 {
     m_playerManager   = GetComponent <PlayerManager>();
     m_inputKeyManager = GetComponent <InputKeyManager>();
 }