Example #1
0
 static int PauseSFXAll2D(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         bool arg0 = LuaDLL.luaL_checkboolean(L, 1);
         AudioPlayManager.PauseSFXAll2D(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    public static void Pause(bool isPause, float fadeTime = 0.5f)
    {
        if (audioGroupPlayState == AudioGroupPlayState.Playing && isPause)
        {
            audioGroupPlayState = AudioGroupPlayState.Pause;
        }
        if (audioGroupPlayState == AudioGroupPlayState.Pause && !isPause)
        {
            audioGroupPlayState = AudioGroupPlayState.Playing;
        }

        for (int i = 0; i < currentAudioGroupData.fixedMusicDatas.Count; i++)
        {
            MusicPlayData data = currentAudioGroupData.fixedMusicDatas[i];
            AudioPlayManager.PauseMusic2D(data.channel, isPause, fadeTime);
        }
        AudioPlayManager.PauseSFXAll2D(isPause);
    }