Exemplo n.º 1
0
        public void OnUpdate()
        {
            if (doRefreshLights && SceneManager.GetActiveScene() != null && SceneManager.GetActiveScene().name == "MenuCore")
            {
                ColourManager.RefreshLights();
                doRefreshLights = false;
            }

            if (Input.GetKeyDown(KeyCode.Backslash))
            {
                ChromaConfig.LoadSettings(ChromaConfig.LoadSettingsType.MANUAL);
            }

            if (Input.GetKeyDown(KeyCode.Period) && ChromaConfig.DebugMode)
            {
                if (Input.GetKey(KeyCode.Alpha1))
                {
                    ColourManager.RecolourNeonSign(ColourManager.SignA, ColourManager.SignB);
                }
                else if (Input.GetKey(KeyCode.Alpha2))
                {
                    ColourManager.RefreshLights();
                }
                else if (Input.GetKey(KeyCode.Alpha3))
                {
                    ChromaTesting.Test();
                }
                else
                {
                    ChromaLogger.Log(" [[ Debug Info ]]");

                    if (ChromaConfig.TechnicolourEnabled)
                    {
                        ChromaLogger.Log("TechnicolourStyles (Lights | Walls | Notes | Sabers) : " + ChromaConfig.TechnicolourLightsStyle + " | " + ChromaConfig.TechnicolourWallsStyle + " | " + ChromaConfig.TechnicolourBlocksStyle + " | " + ChromaConfig.TechnicolourSabersStyle);
                        ChromaLogger.Log("Technicolour (Lights | Walls | Notes | Sabers) : " + ColourManager.TechnicolourLights + " | " + ColourManager.TechnicolourBarriers + " | " + ColourManager.TechnicolourBlocks + " | " + ColourManager.TechnicolourSabers);
                    }

                    DebugButtonPressedEvent?.Invoke();
                }
            }
        }
Exemplo n.º 2
0
        public static void RefreshLights()
        {
            try {
                ChromaLogger.Log("Refreshing Lights");

                Color ambientLight = ColourManager.LightAmbient;
                Color red          = ColourManager.LightAmbient;
                Color blue         = ColourManager.LightAmbient;
                Color redLight     = ColourManager.LightAmbient;
                Color blueLight    = ColourManager.LightAmbient;
                Color platform     = ColourManager.LightAmbient;
                Color signA        = ColourManager.LightAmbient;
                Color signB        = ColourManager.LightAmbient;
                Color laser        = ColourManager.LaserPointerColour;

                string ambientSound = null;

                RefreshLightsEvent?.Invoke(ref ambientLight, ref red, ref blue, ref redLight, ref blueLight, ref platform, ref signA, ref signB, ref laser, ref ambientSound);

                //ColourManager.RecolourAllLights(ColourManager.LightA, ColourManager.LightB);
                ResetAllLights();
                ColourManager.RecolourAmbientLights(ambientLight);
                if (!SceneUtils.IsTargetGameScene(SceneManager.GetActiveScene()))
                {
                    ColourManager.RecolourNeonSign(signA, signB);
                    ColourManager.RecolourMenuStuff(red, blue, redLight, blueLight, platform, laser);
                }

                if (ambientSound == null)
                {
                    AudioUtil.Instance.StopAmbianceSound();
                }
                else
                {
                    AudioUtil.Instance.StartAmbianceSound(ambientSound);
                }
            } catch (Exception e) {
                ChromaLogger.Log("Error refreshing lights!");
                ChromaLogger.Log(e, ChromaLogger.Level.WARNING);
            }
        }