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); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.layer == LayerMask.NameToLayer("Floor")) { m_animFuntion.SetTrigger(m_animFuntion.hashTLend); m_animFuntion.SetBool(m_animFuntion.hashbAir, false); m_animFuntion.ResetTrigger(m_animFuntion.hashTFall); m_animFuntion.ResetTrigger(m_animFuntion.hashTEvasion); m_audioFunction.AudioPlay("Lend", false); m_playerState.PlayerStateReset(); } }
IEnumerator EvasionCoroutine() { m_crowdControlManager.ImpenetrableOn(); m_animFuntion.SetTrigger(m_animFuntion.hashTEvasion); yield return(new WaitForSeconds(0.1f)); if (!m_playerState.IsPlayerGround()) { m_rigidbody2D.constraints = RigidbodyConstraints2D.FreezePositionY | RigidbodyConstraints2D.FreezeRotation; AddMeve(m_speedAir); } else { AddMeve(m_speed); } m_playerState.PlayerStateEvasion(); while (true) { if (!m_animFuntion.IsTag("Evasion")) { break; } yield return(new WaitForSeconds(0.02f)); } m_rigidbody2D.constraints = RigidbodyConstraints2D.FreezeRotation; m_rigidbody2D.velocity = new Vector2(m_rigidbody2D.velocity.x / 3, 0.1f); m_bEvasion = false; m_crowdControlManager.ImpenetrableOff(); if (m_playerState.IsPlayerGround()) { m_playerState.PlayerStateReset(); } else { m_playerState.PlayerStateDoubleJump(); } }
private void Jump() { m_animFuntion.SetTrigger(m_animFuntion.hashBJump); m_characterJump.Jump(m_playerInfo.fJumpforce); m_audioFunction.AudioPlay("Jump", false); }