IEnumerator MoveCoroutine() { m_bMove = true; m_controlManager.ImpenetrableOn(); m_animFuntion.SetBool(m_animFuntion.hashBMove, true); while (true) { if (this.transform.localScale.x < 0) { m_characterMove.MoveLeft(m_playerInfo.fMoveSpeed); } else { m_characterMove.MoveRight(m_playerInfo.fMoveSpeed); } yield return(null); if (!m_bMove) { m_controlManager.ImpenetrableOff(); m_animFuntion.SetBool(m_animFuntion.hashBMove, false); m_characterMove.MoveStop(); yield break; } } }
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(); } }
// 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 Move() { if (Input.GetAxisRaw("Horizontal") < 0) { m_animFuntion.SetBool(m_animFuntion.hashBMove, true); m_characterMove.MoveLeft(m_playerInfo.fMoveSpeed); m_underUI.transform.localScale = new Vector3(-1, 1, 1); } else if (Input.GetAxisRaw("Horizontal") > 0) { m_animFuntion.SetBool(m_animFuntion.hashBMove, true); m_characterMove.MoveRight(m_playerInfo.fMoveSpeed); m_underUI.transform.localScale = new Vector3(1, 1, 1); } else if (m_animFuntion.GetBool(m_animFuntion.hashBMove)) { m_animFuntion.SetBool(m_animFuntion.hashBMove, false); m_characterMove.MoveStop(); } }