// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (m_playerState == null) { m_playerState = animator.gameObject.transform.root.GetComponent <PlayerState>(); } if (m_rigidbody2D == null) { m_rigidbody2D = animator.transform.root.GetComponent <Rigidbody2D>(); } if (m_playerAnim == null) { m_playerAnim = animator.gameObject.GetComponent <PlayerAnimFuntion>(); } m_playerAnim.ResetTrigger(m_playerAnim.hasTDownsmash); m_playerAnim.ResetTrigger(m_playerAnim.hashTUpper); m_playerAnim.ResetTrigger(m_playerAnim.hashTNormalAttack); m_playerAnim.SetBool(m_playerAnim.hashBMove, false); m_playerState.PlayerStateReset(); m_rigidbody2D.velocity = Vector2.zero; }
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(); } }