Пример #1
0
 private void Awake()
 {
     this.tag              = "Player";
     m_Data                = new PlayerInfo();
     m_Parts               = GetComponent <PlayerParts>();
     m_Controller          = GetComponent <PlayerController>();
     m_WeapoonController   = GetComponent <WeaponController>();
     m_StratagemController = GetComponent <StratagemController>();
     m_GrenadesController  = GetComponent <GrenadesController>();
     m_SoundManager        = GetComponent <SoundManager>();
 }
Пример #2
0
 public void Start()
 {
     _grenadesController = gameObject.GetComponent <GrenadesController>();
     SetNextVoiceTime();
 }
Пример #3
0
    private void Start()
    {
        //m_InputSetting = InputMM.Instance.InputSettingMap[2];
        m_PlayerFSM           = new PlayerFSMSystem(this);
        m_Player              = this.GetComponent <Player>();
        m_WeaponController    = this.GetComponent <WeaponController>();
        m_StratagemController = this.GetComponent <StratagemController>();
        m_GrenadesController  = this.GetComponent <GrenadesController>();
        m_PAC        = this.GetComponent <PlayerAnimationsContorller>();
        m_Controller = this.GetComponent <CharacterController>();
        m_Collider   = m_Controller.GetComponent <Collider>();
        m_AimLine    = this.GetComponent <AimLine>();
        if (Camera.main != null)
        {
            m_Cam = Camera.main.transform;
        }

        #region PlayerFSMMap


        m_Animator = m_PAC.Animator;

        PlayerFSMStartState        m_StartState        = new PlayerFSMStartState();
        PlayerFSMGunState          m_GunState          = new PlayerFSMGunState();
        PlayerFSMReloadState       m_RelodaState       = new PlayerFSMReloadState();
        PlayerFSMMeleeAttackState  m_MeleeAttackState  = new PlayerFSMMeleeAttackState();
        PlayerFSMStratagemState    m_StratagemState    = new PlayerFSMStratagemState();
        PlayerFSMThrowState        m_ThrowState        = new PlayerFSMThrowState();
        PlayerFSMThrowBombState    m_ThrowBombState    = new PlayerFSMThrowBombState();
        PlayerFSMSwitchWeaponState m_SwitchWeaponState = new PlayerFSMSwitchWeaponState();
        PlayerFSMPickUpState       m_PickUpState       = new PlayerFSMPickUpState();

        m_StartState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_GunState.AddTransition(ePlayerFSMTrans.Go_MeleeAttack, m_MeleeAttackState);
        m_GunState.AddTransition(ePlayerFSMTrans.Go_Reload, m_RelodaState);
        m_GunState.AddTransition(ePlayerFSMTrans.Go_ThrowBomb, m_ThrowBombState);
        m_GunState.AddTransition(ePlayerFSMTrans.Go_Stratagem, m_StratagemState);
        m_GunState.AddTransition(ePlayerFSMTrans.Go_SwitchWeapon, m_SwitchWeaponState);
        m_GunState.AddTransition(ePlayerFSMTrans.Go_PickUp, m_PickUpState);

        m_MeleeAttackState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_ThrowBombState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_RelodaState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_StratagemState.AddTransition(ePlayerFSMTrans.Go_Throw, m_ThrowState);
        m_StratagemState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_ThrowState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_SwitchWeaponState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_PickUpState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        PlayerFSMRollState    m_RollState    = new PlayerFSMRollState();
        PlayerFSMVictoryState m_VictoryState = new PlayerFSMVictoryState();
        PlayerFSMDeadState    m_DeadState    = new PlayerFSMDeadState();
        PlayerFSMReliveState  m_ReliveState  = new PlayerFSMReliveState();

        m_ReliveState.AddTransition(ePlayerFSMTrans.Go_Gun, m_GunState);

        m_PlayerFSM.AddGlobalTransition(ePlayerFSMTrans.Go_Roll, m_RollState);
        m_PlayerFSM.AddGlobalTransition(ePlayerFSMTrans.Go_Victory, m_VictoryState);
        m_PlayerFSM.AddGlobalTransition(ePlayerFSMTrans.Go_Dead, m_DeadState);
        m_PlayerFSM.AddGlobalTransition(ePlayerFSMTrans.Go_Relive, m_ReliveState);

        m_PlayerFSM.AddState(m_StartState);
        m_PlayerFSM.AddState(m_GunState);
        m_PlayerFSM.AddState(m_MeleeAttackState);
        m_PlayerFSM.AddState(m_ThrowBombState);
        m_PlayerFSM.AddState(m_RelodaState);
        m_PlayerFSM.AddState(m_SwitchWeaponState);
        m_PlayerFSM.AddState(m_StratagemState);
        m_PlayerFSM.AddState(m_ThrowState);
        m_PlayerFSM.AddState(m_PickUpState);
        m_PlayerFSM.AddState(m_VictoryState);
        m_PlayerFSM.AddState(m_DeadState);
        m_PlayerFSM.AddState(m_RollState);

        #endregion
    }