예제 #1
0
        public static CustomLightshowController Create(
            CustomLightshowData lightshowData,
            LightEffectController[] lights,
            ColorScheme colorScheme,
            IAudioTimeSource timeSource,
            LightMode restoreMode,
            float restoreDefaultLightsAfter
            )
        {
            CustomLightshowController controller = new GameObject("TwitchFXCustomLightshowController").AddComponent <CustomLightshowController>();

            if (restoreMode == LightMode.CustomLightshow)
            {
                CustomLightshowController prevLightshow = LightController.instance.lightshowController;

                restoreMode = prevLightshow.restoreMode;
                restoreDefaultLightsAfter = prevLightshow.restoreDefaultLightsAfter;

                prevLightshow.skipRestoreMode = true;

                if (lightshowData.colorPreset != null)
                {
                    controller.restoreSaberColorLeft   = prevLightshow.restoreSaberColorLeft;
                    controller.restoreSaberColorRight  = prevLightshow.restoreSaberColorRight;
                    controller.restoreNoteColorLeft    = prevLightshow.restoreNoteColorLeft;
                    controller.restoreNoteColorRight   = prevLightshow.restoreNoteColorRight;
                    controller.restoreWallColor        = prevLightshow.restoreWallColor;
                    controller.restoreSaberColorsAfter = prevLightshow.restoreSaberColorsAfter;
                    controller.restoreNoteColorsAfter  = prevLightshow.restoreNoteColorsAfter;
                    controller.restoreWallColorAfter   = prevLightshow.restoreWallColorAfter;
                    controller.skipSetRestore          = true;

                    prevLightshow.skipRestoreColors = true;
                }

                Destroy(prevLightshow);
                LightController.instance.lightshowController = null;
            }

            controller.lightshowData             = lightshowData;
            controller.lights                    = lights;
            controller.colorScheme               = colorScheme;
            controller.timeSource                = timeSource;
            controller.restoreMode               = restoreMode;
            controller.restoreDefaultLightsAfter = restoreDefaultLightsAfter;

            return(controller);
        }
예제 #2
0
        public bool ShowCustomLightshow(string name)
        {
            CustomLightshowData lightshowData = CustomLightshowData.GetLightshowData(name);

            if (lightshowData == null)
            {
                return(false);
            }

            CustomLightshowController lightshowController = CustomLightshowController.Create(
                lightshowData,
                lightshowLights,
                colorScheme,
                timeSource,
                mode,
                disableOn
                );

            SetLightMode(LightMode.CustomLightshow);

            this.lightshowController = lightshowController;

            return(true);
        }
예제 #3
0
 public static void SetLightshowData(string name, CustomLightshowData lightshowData)
 {
     lightshows.Add(name.ToLower(), lightshowData);
 }