コード例 #1
0
    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);
    }
コード例 #2
0
    public void SetAudioToPlay(int ID)
    {
        for (int i = 0; i < soundList.Count; i++)
        {
            if (soundList [i].ID == ID)
            {
                curentSoundInfo = soundList [i];

                StartCoroutine(playSequencely());

                return;
            }
        }
    }
コード例 #3
0
    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);
            }
        }
        //   }
    }