|
|
@ -26,6 +26,15 @@ public class CharacterInputController : MonoBehaviour |
|
|
|
[SerializeField] |
|
|
|
private Animator m_animator; |
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
private AudioClip m_DeathSound; |
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
private AudioClip m_VictoryClip; |
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
private AudioClip m_JumpSound; |
|
|
|
|
|
|
|
[SerializeField, BoxGroup("Settings")] |
|
|
|
private float m_speed = 2.0f; |
|
|
|
|
|
|
@ -73,25 +82,32 @@ public class CharacterInputController : MonoBehaviour |
|
|
|
|
|
|
|
public void OnLandHappened() |
|
|
|
{ |
|
|
|
m_animator.SetTrigger("Land"); |
|
|
|
m_animator.SetTrigger("Land"); |
|
|
|
} |
|
|
|
|
|
|
|
public void OnJumpHappened() |
|
|
|
{ |
|
|
|
m_animator.SetTrigger("Land"); |
|
|
|
//AudioSource.PlayClipAtPoint(m_JumpSound, transform.position);
|
|
|
|
} |
|
|
|
public void OnDeath(bool value) |
|
|
|
{ |
|
|
|
if (value) |
|
|
|
if (value) |
|
|
|
{ |
|
|
|
m_animator.SetTrigger("Death"); |
|
|
|
AudioSource.PlayClipAtPoint(m_DeathSound, transform.position); |
|
|
|
} |
|
|
|
else |
|
|
|
m_animator.SetTrigger("Respawn"); |
|
|
|
} |
|
|
|
|
|
|
|
public void OnVictory(bool value) |
|
|
|
{ |
|
|
|
if (value) |
|
|
|
if (value) |
|
|
|
{ |
|
|
|
m_animator.SetTrigger("Victory"); |
|
|
|
AudioSource.PlayClipAtPoint(m_VictoryClip, transform.position); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|