Esempio n. 1
0
    /// <summary>
    /// Change current music and play.
    /// </summary>
    /// <param name="musicName">name of the GameObject that include Music</param>
    public static void Play(string musicName)
    {
        MusicBase music = musicList_.Find((MusicBase m) => m != null && m.name == musicName);

        if (music != null)
        {
            music.Play();
        }
        else
        {
            Debug.Log("Can't find music: " + musicName);
        }
    }
Esempio n. 2
0
    public static void PlayFrom(string musicName, Timing seekTiming, int sequenceIndex = 0)
    {
        MusicBase music = musicList_.Find((MusicBase m) => m != null && m.name == musicName);

        if (music != null)
        {
            music.Seek(seekTiming, sequenceIndex);
            music.Play();
        }
        else
        {
            Debug.Log("Can't find music: " + musicName);
        }
    }