Compare commits
No commits in common. "18a2f9944dce81a98d00f3fef01f8aad344d61a4" and "aed80e1e8551dcdb4cb6574f16a8cbca94b36947" have entirely different histories.
18a2f9944d
...
aed80e1e85
@ -22,15 +22,13 @@ public class AudioManager : MonoBehaviour
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
public void Play(string name, bool checkIfPlay = false)
|
||||
public void Play(string name)
|
||||
{
|
||||
AudioSound s = Array.Find(clips, sound => sound.name == name);
|
||||
if (s == null) {
|
||||
return;
|
||||
}
|
||||
Debug.Log("Sound is playng");
|
||||
if (!s.source.isPlaying || !checkIfPlay) {
|
||||
s.source.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -249,6 +249,7 @@ public class PlayerManager : MonoBehaviour
|
||||
if (Input.GetAxis("Horizontal") > 0)
|
||||
{
|
||||
playerAnimator.SetBool("Walk", true);
|
||||
FindObjectOfType<AudioManager>().Play("Walk");
|
||||
if (pushPullObject == null) {
|
||||
playerAnimator.transform.rotation = Quaternion.Lerp(
|
||||
playerAnimator.transform.rotation,
|
||||
@ -260,6 +261,7 @@ public class PlayerManager : MonoBehaviour
|
||||
else if (Input.GetAxis("Horizontal") < 0)
|
||||
{
|
||||
playerAnimator.SetBool("Walk", true);
|
||||
FindObjectOfType<AudioManager>().Play("Walk");
|
||||
if (pushPullObject == null)
|
||||
{
|
||||
playerAnimator.transform.rotation = Quaternion.Lerp(
|
||||
@ -277,16 +279,6 @@ public class PlayerManager : MonoBehaviour
|
||||
|
||||
void Move()
|
||||
{
|
||||
if (Input.GetAxis("Horizontal") != 0)
|
||||
{
|
||||
if (!run) {
|
||||
FindObjectOfType<AudioManager>().Play("Walk", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
FindObjectOfType<AudioManager>().Play("Run", true);
|
||||
}
|
||||
}
|
||||
rigidBody.MovePosition(
|
||||
transform.position +
|
||||
(onLadder && activeAbility.Count > 0 && activeAbility[0] == 4 ? (transform.up * speed * Input.GetAxis("Vertical") * Time.deltaTime) : Vector3.zero) +
|
||||
|
Loading…
Reference in New Issue
Block a user