コード例 #1
0
 static void Postfix(MusicZone __instance, IVisitor visitor, ISerializable prefabComp, int version)
 {
     if (!(visitor is Serializers.Serializer) && !(visitor is Serializers.Deserializer))
     {
         if (!__instance.HasComponent <ZEventListener>())
         {
             visitor.VisitAction("Set Music Choice", new Action(AddMusicChoiceSelection), null);
         }
     }
 }
コード例 #2
0
        internal static void Postfix(MusicZone __instance, IVisitor visitor)
        {
            LevelEditorLogic levelEditor = Mod.Instance.LevelEditor;

            if (visitor is NGUIComponentInspector)
            {
                if (!__instance.HasComponent <ZEventListener>())
                {
                    visitor.VisitAction("Set Music Choice", levelEditor.AddMusicChoiceSelection, null);
                }
            }
        }
コード例 #3
0
        private void HandleMusicInMode_GAME()
        {
            Grid   grid = LegacyLogic.Instance.MapLoader.Grid;
            String text = GetFightMusicAudioID(grid);

            if (text != null)
            {
                if (!String.IsNullOrEmpty(m_currentAudioID))
                {
                    m_protectedAudioControllerName = AudioManager.Instance.FindCategoryNameByAudioID(m_currentAudioID);
                }
                AudioController.Instance.musicCrossFadeTime_In = 0f;
            }
            else if (m_activeMusicZones.Count > 0)
            {
                MusicZone musicZone = m_activeMusicZones[m_activeMusicZones.Count - 1];
                text = musicZone.MusicAudioID;
                AudioController.Instance.musicCrossFadeTime_In = musicZone.FadeIn;
            }
            else
            {
                if (m_isDay)
                {
                    text = grid.MusicAudioIDDay;
                }
                else
                {
                    text = grid.MusicAudioIDNight;
                }
                AudioController.Instance.musicCrossFadeTime_In = m_defaultMusicFadeInTime;
            }
            if (!String.IsNullOrEmpty(text))
            {
                if (m_currentAudioID != text || m_currentAudioObj == null || m_currentAudioObj.audioID != text)
                {
                    PlayMusic(text, 0f);
                }
            }
            else
            {
                StopMusic(true);
            }
            m_protectedAudioControllerName = null;
        }
コード例 #4
0
 static void Postfix(MusicZone __instance, bool goingIn)
 {
     UnityEngine.Debug.Log($"SetState {goingIn}");
     try
     {
         var previous = CachedMusicZoneData.GetOr(__instance, () => new MusicZoneData());
         if (goingIn)
         {
             previous.PreviousTrackName = CurrentTrackName;
             PlayTrack(GetMusicChoiceValue(__instance.gameObject, "Zone"), 0f);
         }
         else
         {
             PlayTrack(previous.PreviousTrackName, 0f);
         }
     }
     catch (Exception e)
     {
         UnityEngine.Debug.Log($"SetState failed: {e}");
     }
 }
コード例 #5
0
        internal static void Postfix(MusicZone __instance, bool goingIn)
        {
            Mod mod = Mod.Instance;

            try
            {
                var previous = mod.Variables.CachedMusicZoneData.GetOrCreate(__instance, () => new MusicZoneData());
                if (goingIn)
                {
                    previous.PreviousTrackName = mod.Variables.CurrentTrackName;
                    mod.SoundPlayer.PlayTrack(mod.SoundPlayer.GetMusicChoiceValue(__instance.gameObject, "Zone"), 0f);
                }
                else
                {
                    mod.SoundPlayer.PlayTrack(previous.PreviousTrackName, 0f);
                }
            }
            catch (Exception e)
            {
                Mod.Instance.Logger.Error($"SetState failed: {e}");
                Mod.Instance.Logger.Exception(e);
            }
        }
コード例 #6
0
 static void Postfix(MusicZone __instance)
 {
     PlayTrack(GetMusicChoiceValue(__instance.gameObject, "Zone"), 0f);
 }
コード例 #7
0
        internal static void Postfix(MusicZone __instance)
        {
            SoundPlayerLogic soundPlayer = Mod.Instance.SoundPlayer;

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