Exemplo n.º 1
0
    void TestMusic()
    {
        int musicIndex = 1;

        XLSound.PlaySound(Sounds.My_Song_6, 5.0f);

        Timers.AsyncSetTimeout(40.0f, (Action <BaseTimer>)((x) =>
        {
            L.Log(LogEventType.EVENT, $"Should switch Music: {musicIndex}");
            if (musicIndex.Equals(0))
            {
                XLSound.PlaySound((Sounds)Sounds.My_Song_6, 7.0f);
            }
            else if (musicIndex.Equals(1))
            {
                XLSound.PlaySound((Sounds)Sounds.XWingsAttack_complete_master, 7.0f);
            }
            else if (musicIndex.Equals(2))
            {
                XLSound.PlaySound((Sounds)Sounds.ExhaustPort_complete_master, 7.0f);
            }

            musicIndex++;
            musicIndex = musicIndex > 2 ? 0 : musicIndex;
        }), true);
    }
Exemplo n.º 2
0
    void LoadTestScene()
    {
        Timers.AsyncSetTimeout(5.0f, (x) =>
        {
            SceneManager.LoadSceneAsync("SampleScene", LoadSceneMode.Additive);

            Timers.AsyncSetTimeout(5.0f, (xx) =>
            {
                SceneManager.UnloadSceneAsync("SampleScene");
            });
        });
    }
Exemplo n.º 3
0
    void TestMuting()
    {
        Timers.AsyncSetTimeout(5.0f, (x) =>
        {
            XLSound.Mute();

            Timers.AsyncSetTimeout(10.0f, (xx) =>
            {
                XLSound.UnMute();
            });
        });
    }