private void Move() { m_Rigidbody2D.velocity = new Vector2(m_HorizontalAxis * m_MoveSpeed, m_Rigidbody2D.velocity.y); Vector3 m_MousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); if (m_MousePos.x > transform.position.x) { transform.GetChild(0).localScale = new Vector3(1, transform.localScale.y, 0); } else if (m_MousePos.x < transform.position.x) { transform.GetChild(0).localScale = new Vector3(-1, transform.localScale.y, 0); } if (m_Rigidbody2D.velocity.x != 0 && m_Jumper.IsGrounded() && !playingSound) { StartCoroutine(MoveSound()); } }
private bool IsGrounded() { return(jumper.IsGrounded()); }