Exemple #1
0
        private void OnGUI()
        {
            if (UERP.discord == null)
            {
                UERP.Init();
            }
            GUILayout.Label("Unity Editor Rich Presence", EditorStyles.boldLabel);

            GUILayout.Label("Current Project: " + UERP.projectName);
            GUILayout.Label("Current Scene: " + UERP.sceneName);


            if (ToggleButton("Hide Scene name", "Show Scene name", ref UERP.showSceneName))
            {
                UERP.UpdateActivity();
            }
            if (ToggleButton("Hide Project name", "Show Project name", ref UERP.showProjectName))
            {
                UERP.UpdateActivity();
            }
            if (ToggleButton("Don't reset timestap on scene change", "Reset timestap on scene change", ref UERP.resetOnSceneChange))
            {
                UERP.UpdateActivity();
            }
            ToggleButton("Disable Debug Mode", "Enable Debug Mode", ref UERP.debugMode);
        }
Exemple #2
0
 private static void ApplySettings(UERPSettings settings)
 {
     UERP.showSceneName      = settings.showSceneName;
     UERP.showProjectName    = settings.showProjectName;
     UERP.resetOnSceneChange = settings.resetOnSceneChange;
     UERP.debugMode          = settings.debugMode;
     if (UERP.debugMode)
     {
         UERP.Log("Applyed Settings from file");
     }
 }
Exemple #3
0
        public static void SaveSettings()
        {
            UERPSettings settings = new UERPSettings(UERP.showSceneName, UERP.showProjectName, UERP.resetOnSceneChange, UERP.debugMode);

            XmlSerializer serializer = new XmlSerializer(typeof(UERPSettings));
            var           stream     = new FileStream(path, FileMode.Create);

            serializer.Serialize(stream, settings);
            stream.Close();
            if (UERP.debugMode)
            {
                UERP.Log("Saved Settings");
            }
        }