public soundInfo GetSoundData(string name) { Sound s = Array.Find(sounds, sound => sound.name == name); soundInfo SI = new soundInfo(); SI.length = s.source.clip.length; SI.currentTime = s.source.time; return(SI); }
public void SetAudioToPlay(int ID) { for (int i = 0; i < soundList.Count; i++) { if (soundList [i].ID == ID) { curentSoundInfo = soundList [i]; StartCoroutine(playSequencely()); return; } } }
IEnumerator waitForEndOfJourney() { // while (true) { while (playing) { yield return(new WaitForSeconds(0.5f)); soundInfo SI = _audioManager.GetSoundData(CurrentJourneyName); if (SI.currentTime >= SI.length * 0.99f) { EndSceneUI.SetActive(true); } } // } }