|
|
@ -3,6 +3,8 @@ using System.Collections; |
|
|
|
|
|
|
|
public class PlayerSounds : MonoBehaviour { |
|
|
|
|
|
|
|
public GameObject PlayerObject; |
|
|
|
|
|
|
|
private AudioSource source; |
|
|
|
private float volLowRange = 0.5f; // Volume Low Range
|
|
|
|
private float volHighRange = 1.0f; // Volume High Range
|
|
|
@ -10,11 +12,11 @@ public class PlayerSounds : MonoBehaviour { |
|
|
|
private float pitchHighRange = 1.5f; // Pitch High Range
|
|
|
|
private float pitchDefault = 1.0f; // Pitch Default Value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// AUDIO CLIPS
|
|
|
|
// All sound effects are listed here.
|
|
|
|
public AudioClip sfxFootstep; |
|
|
|
public AudioClip sfxFootSand; |
|
|
|
public AudioClip sfxFootFloor; |
|
|
|
public AudioClip sfxTEST; |
|
|
|
public AudioClip sfxSwitch; |
|
|
|
public AudioClip sfxPickUp; |
|
|
@ -34,12 +36,18 @@ public class PlayerSounds : MonoBehaviour { |
|
|
|
|
|
|
|
void PlayFootstep(){ |
|
|
|
float volRandom = Random.Range (volLowRange, volHighRange); |
|
|
|
|
|
|
|
// SAND GROUND
|
|
|
|
source.pitch = Random.Range (pitchLowRange, pitchHighRange); |
|
|
|
source.PlayOneShot (sfxFootstep,volRandom); |
|
|
|
source.PlayOneShot (sfxFootSand,volRandom); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void PlayTest(){ |
|
|
|
float volRandom = Random.Range (volLowRange, volHighRange); |
|
|
|
|
|
|
|