예제 #1
0
 private void PlaySoundFrom(SoundStateInfo state)
 {
     if (Time.time > state.barredTime)
     {
         AudioClip clip = state.sounds[Random.Range(0, state.sounds.Length)];
         SoundManagerController.Instance.PlaySoundAt(clip, transform);
         state.barredTime = clip.length + Time.time;
         timeTilPlay += clip.length;
     }
 }
예제 #2
0
 public void SetState(string name)
 {
     SoundStateInfo found = getState(name);
     if (found == null)
         Debug.Log("Sound state [" + name + "] does not exist");
     else
     {
         if( currentState == null )
             timeTilPlay = Random.Range(found.minDelay, found.maxDelay);
         currentState = found;
     }
 }
예제 #3
0
 void Start()
 {
     currentState = null;
 }