コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        // get pick up item input
        if (InputMgr.GetButton((int)m_input.m_nbPlayer, InputMgr.eButton.GRAB) && !IsGrabing)
        {
            if (WeaponList.Count > 0)
            {
                PickupWeapon();
            }
        }
        IsGrabing = InputMgr.GetButton((int)m_input.m_nbPlayer, InputMgr.eButton.GRAB);

        switch (m_attack.EquipWeap)
        {
        case PlayerAttack.eWeapon.Pistol:
            m_weapon.PickPistol();
            break;

        case PlayerAttack.eWeapon.Saber:
            m_weapon.PickSaber();
            break;

        default:
            m_weapon.Drop();
            break;
        }
    }
コード例 #2
0
    // ======================================================================================
    private void UpdateAnimator()
    {
        m_animator.SetDirection(m_states[m_actualState].m_facingDir);
        if (m_states[m_actualState].m_attack)
        {
            m_animator.StartAttack(m_states[m_actualState].m_attkType, m_states[m_actualState].m_upAttkDir, false);
            if (m_watcherToShowWeapon != null)
            {
                switch (m_states[m_actualState].m_attkType)
                {
                case PlayerAnimatorController.eAttackType.Fists:
                    m_watcherToShowWeapon.Drop();
                    break;

                case PlayerAnimatorController.eAttackType.Saber:
                    m_watcherToShowWeapon.PickSaber();
                    break;

                case PlayerAnimatorController.eAttackType.Pistol:
                    m_watcherToShowWeapon.PickPistol();
                    break;
                }
            }
        }
        else
        {
            m_animator.SetState(m_states[m_actualState].m_state);
        }
    }
コード例 #3
0
 public void Start()
 {
     m_timer = 0;
     m_objHand.PickSaber();
 }