Ejemplo n.º 1
0
 static void Postfix(LevelSettings __instance, IVisitor visitor, ISerializable prefabComp, int version)
 {
     Entry.DownloadAllTracks();
     if (!(visitor is Serializers.Serializer) && !(visitor is Serializers.Deserializer))
     {
         visitor.VisitAction("Toggle Custom Music", new Action(ToggleCustomMusic), null);
         visitor.VisitAction("Add Music Track", new Action(AddMusicTrack), null);
         if (!__instance.HasComponent <ZEventListener>())
         {
             visitor.VisitAction("Set Music Choice", new Action(AddMusicChoiceLevelSettings), null);
         }
         Entry.PlayTrack(Entry.GetMusicChoiceValue(__instance.gameObject, "Level"), 2000f);
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }