Exemplo n.º 1
0
    private static void PlayRandom()
    {
        //Debug.Log("MusicManager.PlayRandom()");

        _currMusic = PlayMaracasFirst();

        secCount++;

        if (secCount > 1000)
        {
            throw new Exception("Trying to reach Random music over 1000 times");
        }

        //if is contained we need a new one
        if (_playedSongs.Contains(_currMusic.Key))
        {
            PlayRandom();
            return;
        }

        secCount = 0;
        _currMusic.PlayMusicAShot();
    }