Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     ChromaPlugin.UpdatePlugin();
     centroid_y = (float)ChromaPlugin.GetNormCentroid_y();
     Debug.Log(centroid_y);
     instructionsLabel.text = "INSTRUCTIONS:\ny: " + centroid_y.ToString() + "\nJUMP WHEN y < 0.8\n";
     //if (Input.GetKeyDown(KeyCode.Space) && canJump && isAlive)
     //      {
     //          Jump();
     //      }
     if (isFirstPlay && !canPlay)
     {
         if (centroid_y < 0.8)
         {
             scoreLabel.text = "Move backwards until your character stops jumping. " + centroid_y.ToString("n2") + " > 0.8";
         }
         else
         {
             scoreLabel.text = "0";
             canPlay         = true;
             isFirstPlay     = false;
         }
     }
     if (centroid_y < 0.8f && canJump && isAlive)
     {
         Jump();
     }
     if (canPlay)
     {
         scoreLabel.text = "score: " + score.ToString() + " | y: " + centroid_y.ToString("n2");
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        ChromaPlugin.UpdatePlugin();
        //Debug.Log((float)ChromaPlugin.GetNormCentroid_x());
        float   x    = (float)ChromaPlugin.GetNormCentroid_x() - 0.5f;
        Vector3 nPos = new Vector3(x * -10.0f, 0, 0);

        transform.position = nPos;
        //Debug.Log(x);
    }
Exemplo n.º 3
0
        private static void OnLoadSettingsEvent(BS_Utils.Utilities.Config iniProfile, LoadSettingsType type)
        {
            try {
                ChromaLogger.Log("Loading settings [" + type.ToString() + "]", ChromaLogger.Level.INFO);

                //string iniName = ModPrefs.GetString("Chroma", "ConfigProfile", "default", true); //TODO get the thing
                string iniName = "settings";
                IniProfile = new BS_Utils.Utilities.Config("Chroma/Preferences/" + iniName);

                ChromaLogger.Log("--- From file " + iniName);

                BS_Utils.Gameplay.GetUserInfo.UpdateUserInfo();
                Username = BS_Utils.Gameplay.GetUserInfo.GetUserName();
                UserID   = BS_Utils.Gameplay.GetUserInfo.GetUserID();

                ChromaLogger.Log(Greetings.GetGreeting(UserID, Username), ChromaLogger.Level.INFO);
                if (DebugMode)
                {
                    ChromaLogger.Log("=== YOUR ID : " + UserID.ToString());
                }

                if (type == LoadSettingsType.INITIAL)
                {
                    timesLaunched = ChromaConfig.GetInt("Other", "timesLaunched", timesLaunched + 1);
                    ChromaConfig.SetInt("Other", "timesLaunched", timesLaunched);
                }


                /*
                 * MAP
                 */

                customMapCheckingEnabled   = ChromaConfig.GetBool("Map", "customMapCheckingEnabled", true);
                customColourEventsEnabled  = ChromaConfig.GetBool("Map", "customColourEventsEnabled", true);
                customSpecialEventsEnabled = ChromaConfig.GetBool("Map", "customSpecialEventsEnabled", true);
                ChromaPlugin.SetRGBCapability(customColourEventsEnabled);
                ChromaPlugin.SetSpecialEventCapability(CustomSpecialEventsEnabled);

                /*
                 * AUDIO
                 */

                masterVolume = Mathf.Clamp01(ChromaConfig.GetFloat("Audio", "masterVolume", 1));

                AudioUtil.Instance.SetVolume(masterVolume);

                /*
                 * TECHNICOLOUR
                 */

                if (type == LoadSettingsType.INITIAL)
                {
                    technicolourEnabled = ChromaConfig.GetBool("Technicolour", "technicolourEnabled", false);

                    technicolourLightsStyle = (TechnicolourStyle)ChromaConfig.GetInt("Technicolour", "technicolourLightsStyle", 1);
                    //technicolourLightsIndividual = GetBool("Technicolour", "technicolourLightsIndividual", technicolourLightsIndividual);
                    technicolourLightsGrouping = (TechnicolourLightsGrouping)ChromaConfig.GetInt("Technicolour", "technicolourLightsGrouping", 1);
                    if (technicolourLightsGrouping == TechnicolourLightsGrouping.ISOLATED)
                    {
                        TechnicolourLightsGrouping = TechnicolourLightsGrouping.ISOLATED_GROUP;
                    }
                    technicolourLightsFrequency = GetFloat("Technicolour", "technicolourLightsFrequency", technicolourLightsFrequency);
                    technicolourSabersStyle     = (TechnicolourStyle)ChromaConfig.GetInt("Technicolour", "technicolourSabersStyle", 0);
                    technicolourBlocksStyle     = (TechnicolourStyle)ChromaConfig.GetInt("Technicolour", "technicolourBlocksStyle", 0);
                    technicolourWallsStyle      = (TechnicolourStyle)ChromaConfig.GetInt("Technicolour", "technicolourWallsStyle", 0);
                    matchTechnicolourSabers     = ChromaConfig.GetBool("Technicolour", "matchTechnicolourSabers", false);
                }

                string[] technicolourColdString = ChromaConfig.GetString("Technicolour", "technicolourB", "0;128;255;255-0;255;0;255-0;0;255;255-0;255;204;255").Split('-');
                string[] technicolourWarmString = ChromaConfig.GetString("Technicolour", "technicolourA", "255;0;0;255-255;0;255;255-255;153;0;255-255;0;102;255").Split('-');

                Color[] technicolourCold = new Color[technicolourColdString.Length];
                Color[] technicolourWarm = new Color[technicolourWarmString.Length];

                for (int i = 0; i < Mathf.Max(technicolourCold.Length, technicolourWarm.Length); i++)
                {
                    if (i < technicolourCold.Length)
                    {
                        technicolourCold[i] = ColourManager.ColourFromString(technicolourColdString[i]);
                    }
                    if (i < technicolourWarm.Length)
                    {
                        technicolourWarm[i] = ColourManager.ColourFromString(technicolourWarmString[i]);
                    }
                }

                ColourManager.TechnicolourWarmPalette = technicolourWarm;
                ColourManager.TechnicolourColdPalette = technicolourCold;

                /*
                 * NOTES
                 */

                ColourManager.A           = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Notes", "colourA", "DEFAULT"), ColourManager.DefaultA);
                ColourManager.B           = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Notes", "colourB", "DEFAULT"), ColourManager.DefaultB);
                ColourManager.AltA        = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Notes", "colourAltA", "Notes Magenta"), ColourManager.DefaultAltA);
                ColourManager.AltB        = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Notes", "colourAltB", "Notes Green"), ColourManager.DefaultAltB);
                ColourManager.NonColoured = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Notes", "colourNonColoured", "Notes White"), ColourManager.DefaultNonColoured);
                ColourManager.DoubleHit   = ColourManager.DoubleHit = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Notes", "colourDuochrome", "Notes Purple"));
                ColourManager.Super       = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Notes", "colourSuper", "Notes Gold"), ColourManager.DefaultSuper);

                /*
                 * LIGHTS
                 */

                ColourManager.LightAmbient = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Lights", "lightAmbient", "DEFAULT"), ColourManager.DefaultLightAmbient);
                ColourManager.LightA       = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Lights", "lightColourA", "DEFAULT"), ColourManager.DefaultLightA);
                ColourManager.LightB       = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Lights", "lightColourB", "DEFAULT"), ColourManager.DefaultLightB);
                ColourManager.LightAltA    = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Lights", "lightColourAltA", "Light Magenta"), ColourManager.DefaultLightAltA);
                ColourManager.LightAltB    = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Lights", "lightColourAltB", "Light Green"), ColourManager.DefaultLightAltB);
                ColourManager.LightWhite   = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Lights", "lightColourWhite", "Light White"), ColourManager.DefaultLightWhite);
                ColourManager.LightGrey    = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Lights", "lightColourGrey", "Light Grey"), ColourManager.DefaultLightGrey);

                /*
                 * AESTHETICS
                 */

                ColourManager.BarrierColour      = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Aesthetics", "barrierColour", "Barrier Red"), ColourManager.DefaultBarrierColour);
                ColourManager.LaserPointerColour = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Aesthetics", "laserPointerColour", "DEFAULT"), ColourManager.DefaultB);
                ColourManager.SignA    = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Aesthetics", "signColourA", "DEFAULT"), ColourManager.DefaultA);
                ColourManager.SignB    = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Aesthetics", "signColourB", "DEFAULT"), ColourManager.DefaultB);
                ColourManager.Platform = ChromaSettingsUI.GetColor(ChromaConfig.GetString("Aesthetics", "platformAccoutrements", "DEFAULT"), ColourManager.DefaultB);

                ColourManager.barrierColourCorrectionScale = ChromaConfig.GetFloat("Aesthetics", "barrierColourCorrectionScale", 1f);
                ChromaConfig.saberTrailStrength            = ChromaConfig.GetFloat("Aesthetics", "saberTrailStrength", 1f);

                /*
                 * MODIFIERS
                 */
                lightshowModifier = ChromaConfig.GetBool("Modifiers", "lightshowModifier", false);

                /*
                 * OTHER
                 */

                legacyLighting = ChromaConfig.GetBool("Other", "legacyLighting", false);

                debugMode = ChromaConfig.GetBool("Other", "debugMode", false);

                hideSubMenus = ChromaConfig.GetBool("Other", "hideSubMenus", false);

                waiverRead = ChromaConfig.GetInt("Other", "safetyWaiver", 0) == 51228;

                /*string waiverFilePath = Environment.CurrentDirectory.Replace('\\', '/') + "/UserData/ChromaToggle/waiver_411.txt";
                 * if (File.Exists(waiverFilePath)) {
                 *  waiverRead = true;
                 *  ChromaLogger.Log("Waiver found.");
                 * }*/

                ColourManager.RefreshLights();

                if (type == LoadSettingsType.MANUAL)
                {
                    AudioUtil.Instance.PlayOneShotSound("ConfigReload.wav");
                }
            } catch (Exception e) {
                ChromaLogger.Log("Error loading Chroma configs!  Waduhek", ChromaLogger.Level.ERROR);
                ChromaLogger.Log(e);
            }
        }
Exemplo n.º 4
0
 public void ChromaApplicationStarted(ChromaPlugin chromaPlugin)
 {
     ChromaSparksConfig.RegisterListeners();
     ChromaSparksSettingsUI.RegisterListeners();
 }
Exemplo n.º 5
0
    //public ChromaPlugin chromaPlugin;

    // Use this for initialization
    void Start()
    {
        ChromaPlugin.InitCamera();
    }
Exemplo n.º 6
0
 private void OnApplicationQuit()
 {
     ChromaPlugin.TerminatePlugin();
     //TerminatePlugin();
     //Debug.Log("realeasing camera");
 }
Exemplo n.º 7
0
 private static void SpecialEventsToggled(bool b)
 {
     ChromaConfig.CustomSpecialEventsEnabled = b;
     ChromaPlugin.SetSpecialEventCapability(b);
 }
Exemplo n.º 8
0
 private static void RGBEventsToggled(bool b)
 {
     ChromaConfig.CustomColourEventsEnabled = b;
     ChromaPlugin.SetRGBCapability(b);
 }
Exemplo n.º 9
0
 private void OnApplicationQuit()
 {
     ChromaPlugin.TerminatePlugin();
 }
Exemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     ChromaPlugin.InitCamera();
     playerRB  = GetComponent <Rigidbody>();
     jumpForce = new Vector3(0.0f, 600f, 0.0f);
 }