Ejemplo n.º 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;
        }
    }
    // ======================================================================================
    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);
        }
    }
Ejemplo n.º 3
0
    public void Update()
    {
        if (m_timer > m_duration)
        {
            m_objGround.SetActive(true);
            m_objHand.Drop();
            m_timer = 0;
        }

        if (m_timer > m_ratio * m_duration)
        {
            m_objGround.SetActive(false);
            m_objHand.PickPistol();
        }

        m_timer += Time.deltaTime;
    }