public Song GetSong(SongTrigger trigger) { foreach (ContextualSublist sublist in playlistSongs) { if (sublist.trigger == trigger) { return(sublist.songsToPlay[UnityEngine.Random.Range(0, sublist.songsToPlay.Count - 1)]); } } Debug.LogErrorFormat("The playlist {0} was searched for {1} trigger but none was found.", name, trigger.ToString()); throw new NullReferenceException(); }
public void SetTriggerForCurrentSong(TriggerMessage aTrig) { SongTrigger tT = new SongTrigger(); tT.mTrigger = aTrig; tT.mIndex = mCurrentSongIndex; mSongTriggers.Add(tT); }
public ContextualSublist(SongTrigger songTrigger) { name = songTrigger.ToString(); trigger = songTrigger; songsToPlay = new List <Song>(); }