Ejemplo n.º 1
0
        private void TextureSettingsGUI()
        {
            EditorGUIUtility.labelWidth = 100;
            EditorGUIUtility.fieldWidth = 150;
            EditorGUILayout.LabelField("Texture options:", EditorStyles.boldLabel);
            bool changed = GuiHelper.GUIDataStruct <TextureData>(textureSettings, new string[] { "name" });

            if (changed)
            {
                FileHelper.SaveValueToFile("gradient_texture_options_" + prop.name, Parser.ObjectToString(textureSettings), PATH.PERSISTENT_DATA);
                UpdateGradientPreviewTexture();
            }
        }
Ejemplo n.º 2
0
 private static void DeleteVRCSDKFolder()
 {
     if (!Get().sdk_is_installed)
     {
         FileHelper.SaveValueToFile("delete_vrc_sdk", "false", PATH.AFTER_COMPILE_DATA);
         Settings.is_changing_vrc_sdk = false;
     }
     if (Get().sdk_path != null && Directory.Exists(Get().sdk_path))
     {
         Directory.Delete(Get().sdk_path, true);
         AssetDatabase.Refresh();
     }
     Update();
 }
Ejemplo n.º 3
0
 public override void Draw()
 {
     GUILayout.Label("Discord Rich Presence", EditorStyles.boldLabel);
     EditorGUI.BeginChangeCheck();
     GUILayout.BeginHorizontal();
     GUILayout.Label("Update rate: ", GUILayout.ExpandWidth(false));
     data.update_rate = GUILayout.HorizontalSlider(data.update_rate, 0, 10);
     GUILayout.Label(((int)(data.update_rate * 10)) / 10.0 + " seconds", GUILayout.ExpandWidth(false));
     GUILayout.EndHorizontal();
     if (EditorGUI.EndChangeCheck())
     {
         FileHelper.SaveValueToFile("drp", data.ToString(), ModuleSettings.MODULES_CONFIG);
     }
 }
Ejemplo n.º 4
0
 public void OnDestroy()
 {
     if (gradient_has_been_edited)
     {
         if (data.preview_texture.GetType() == typeof(Texture2D))
         {
             string  file_name = GradientFileName(data.gradient, prop.targets[0].name);
             Texture saved     = TextureHelper.SaveTextureAsPNG((Texture2D)data.preview_texture, PATH.TEXTURES_DIR + "/Gradients/" + file_name, textureSettings);
             file_name = Regex.Replace(file_name, @"\.((png)|(jpg))$", "");
             FileHelper.SaveValueToFile(AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(saved)), Parser.ObjectToString(data.gradient), PATH.GRADIENT_INFO_FILE);
             prop.textureValue = saved;
         }
     }
     else
     {
         UpdatePreviewTexture(privious_preview_texture);
     }
 }
Ejemplo n.º 5
0
 public static void Set(string key, string value)
 {
     FileHelper.SaveValueToFile(key, value, PATH.PERSISTENT_DATA);
 }
Ejemplo n.º 6
0
 public void UpdateVRCSDK()
 {
     FileHelper.SaveValueToFile("update_vrc_sdk", "true", PATH.AFTER_COMPILE_DATA);
     this.RemoveVRCSDK();
 }
Ejemplo n.º 7
0
 public void RemoveVRCSDK(bool refresh)
 {
     FileHelper.SaveValueToFile("delete_vrc_sdk", "true", PATH.AFTER_COMPILE_DATA);
     UnityHelper.SetDefineSymbol(DEFINE_SYMBOLS.VRC_SDK_INSTALLED, false);
     AssetDatabase.Refresh();
 }
Ejemplo n.º 8
0
 public static void UpdateVRCSDK()
 {
     FileHelper.SaveValueToFile("update_vrc_sdk", "true", PATH.AFTER_COMPILE_DATA);
     FileHelper.SaveValueToFile("update_vrc_sdk_type", "" + (int)VRCInterface.Get().GetInstalledSDKType(), PATH.AFTER_COMPILE_DATA);
     RemoveVRCSDK();
 }