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