Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using Assets.Sonic.SUF.Actions;
  4. using Assets.Sonic.SUF.Utils;
  5. using Assets.Sonic.SUF.Utils.StateMachines;
  6.  
  7. public class PlaySoundEffects : MonoBehaviour {
  8.  
  9. public AudioClip JumpSound;
  10. public AudioClip SpinSound;
  11. public AudioClip SpinDash;
  12. public AudioClip SpinDashRelease;
  13. public AudioClip Roll;
  14. public AudioClip QuickStep;
  15. bool PlayAudio = false;
  16.  
  17. Assets.Sonic.SUF.Actors.PlayerActor _playerActor;
  18.  
  19. // Use this for initialization
  20. void Start () {
  21. _playerActor = gameObject.GetComponent <Assets.Sonic.SUF.Actors.PlayerActor>();
  22.  
  23. }
  24.  
  25. // Update is called once per frame
  26. void Update () {
  27. if (_playerActor.IsDodging())
  28. {
  29. audio.PlayOneShot (QuickStep);
  30. }
  31. if (_playerActor.IsInState (typeof(JumpState)))
  32. {
  33. audio.PlayOneShot (JumpSound);
  34. }
  35.  
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement