Ejemplo n.º 1
0
    public void NormalAttack()
    {
        if (!m_playerState.IsPlayerGround() && Physics2D.Raycast(this.transform.position, -this.transform.up, fAirAttackDistansce, 1 << LayerMask.NameToLayer("Floor")))
        {
            return;
        }

        m_animFuntion.SetTrigger(m_animFuntion.hashTNormalAttack);

        if (!m_playerState.IsPlayerGround() && !m_playerState.IsPlayerSPAttack())
        {
            RaycastHit2D[] raycastHit2D = Physics2D.BoxCastAll(this.transform.position + new Vector3(0, this.transform.localScale.y * 2, 0), GetComponent <BoxCollider2D>().size, 0.0f,
                                                               this.transform.localScale.x * this.transform.right,
                                                               fAirAttackDistansce, 1 << LayerMask.NameToLayer("Monster"));

            if (raycastHit2D.Length != 0)
            {
                m_playerCrowdControlManager.OnAirStop();
            }
            else
            {
                m_playerCrowdControlManager.OffAirStop();
            }
        }

        if (Input.GetAxisRaw("Vertical") > 0 || m_playerInput.joystickState == PlayerInput.JOYSTICK_STATE.JOYSTICK_UP)
        {
            m_animFuntion.SetTrigger(m_animFuntion.hashTUpper);
        }
        else if (Input.GetAxisRaw("Vertical") < 0 || m_playerInput.joystickState == PlayerInput.JOYSTICK_STATE.JOYSTICK_DOWN)
        {
            m_animFuntion.SetTrigger(m_animFuntion.hasTDownsmash);
        }
    }