Example #1
0
 internal static void Postfix()
 {
     if (AudioManager.AllowCustomMusic_)
     {
         SoundPlayerLogic soundPlayer = Mod.Instance.SoundPlayer;
         soundPlayer.DownloadAllTracks();
         soundPlayer.PlayTrack(soundPlayer.GetMusicChoiceValue(G.Sys.GameManager_.LevelSettings_.gameObject, "Level"), 0f);
     }
 }
        internal static void Postfix(LevelSettings __instance, IVisitor visitor)
        {
            SoundPlayerLogic soundPlayer = Mod.Instance.SoundPlayer;
            LevelEditorLogic levelEditor = Mod.Instance.LevelEditor;

            soundPlayer.DownloadAllTracks();

            if (!(visitor is Serializers.Serializer) && !(visitor is Serializers.Deserializer))
            {
                visitor.VisitAction("Toggle Custom Music", levelEditor.ToggleCustomMusic, null);
                visitor.VisitAction("Add Music Track", levelEditor.AddMusicTrack, null);

                if (!__instance.HasComponent <ZEventListener>())
                {
                    visitor.VisitAction("Set Music Choice", levelEditor.AddMusicChoiceLevelSettings, null);
                }

                soundPlayer.PlayTrack(soundPlayer.GetMusicChoiceValue(__instance.gameObject, "Level"), 2000f);
            }
        }
        internal static void Postfix(AudioEventTrigger __instance)
        {
            SoundPlayerLogic soundPlayer = Mod.Instance.SoundPlayer;

            soundPlayer.PlayTrack(soundPlayer.GetMusicChoiceValue(__instance.gameObject, "Trigger"), 0f);
        }
        internal static void Postfix(MusicZone __instance)
        {
            SoundPlayerLogic soundPlayer = Mod.Instance.SoundPlayer;

            soundPlayer.PlayTrack(soundPlayer.GetMusicChoiceValue(__instance.gameObject, "Zone"), 0f);
        }