private static void BackupMaterialWithTests(Material m)
        {
            string guid = UnityHelper.GetGUID(m);
            string backedup_shader_name = FileHelper.LoadValueFromFile(guid, PATH.MATERIALS_BACKUP_FILE);

            if (m == null)
            {
                return;
            }
            if (MaterialShaderBroken(m))
            {
                return;
            }
            if (backedup_shader_name == m.shader.name)
            {
                return;
            }
            string default_shader_name = ShaderHelper.getDefaultShaderName(m.shader.name);

            if (default_shader_name.Equals(backedup_shader_name))
            {
                return;
            }
            FileHelper.SaveValueToFile(guid, default_shader_name, PATH.MATERIALS_BACKUP_FILE);
        }
Ejemplo n.º 2
0
 public static void OnCompile()
 {
     if (Get().sdk_information.type == VRC_SDK_Type.NONE && FileHelper.LoadValueFromFile("update_vrc_sdk", PATH.AFTER_COMPILE_DATA) == "true")
     {
         DownloadAndInstallVRCSDK((VRC_SDK_Type)int.Parse(FileHelper.LoadValueFromFile("update_vrc_sdk_type", PATH.AFTER_COMPILE_DATA)));
     }
 }
Ejemplo n.º 3
0
        public static void SetVRCDefineSybolIfSDKDeleted(string[] importedAssets)
        {
            bool currently_deleteing_sdk = (FileHelper.LoadValueFromFile("delete_vrc_sdk", PATH.AFTER_COMPILE_DATA) == "true");

            if (!Settings.is_changing_vrc_sdk && !currently_deleteing_sdk && AssetsContainVRCSDK(importedAssets))
            {
                UnityHelper.SetDefineSymbol(DEFINE_SYMBOLS.VRC_SDK_INSTALLED, false);
                Update();
            }
        }
Ejemplo n.º 4
0
        public static void SetVRCDefineSybolIfSDKDeleted(string[] importedAssets)
        {
            bool currently_deleteing_sdk = (FileHelper.LoadValueFromFile("delete_vrc_sdk", PATH.AFTER_COMPILE_DATA) == "true");

            if (!Settings.is_changing_vrc_sdk && !currently_deleteing_sdk && AssetsContainVRCSDK(importedAssets))
            {
                RemoveDefineSymbols();
                Update();
            }
        }
Ejemplo n.º 5
0
 public static void OnCompile()
 {
     if (FileHelper.LoadValueFromFile("delete_vrc_sdk", PATH.AFTER_COMPILE_DATA) == "true")
     {
         DeleteVRCSDKFolder();
     }
     if (!Get().sdk_is_installed&& FileHelper.LoadValueFromFile("update_vrc_sdk", PATH.AFTER_COMPILE_DATA) == "true")
     {
         DownloadAndInstallVRCSDK();
     }
 }
Ejemplo n.º 6
0
        private static bool LoadModuleLocationData(Module m)
        {
            string data = FileHelper.LoadValueFromFile(m.id, PATH.MODULES_LOCATION__DATA);

            if (data == "" || data == null)
            {
                return(false);
            }
            m.location_data = Parser.ParseToObject <ModuleLocationData>(data);
            return(true);
        }
        public static void OnCompile()
        {
            string url  = FileHelper.LoadValueFromFile("update_module_url", PATH.AFTER_COMPILE_DATA);
            string name = FileHelper.LoadValueFromFile("update_module_name", PATH.AFTER_COMPILE_DATA);

            if (url != null && url.Length > 0 && name != null && name.Length > 0)
            {
                InstallModule(url, name);
                FileHelper.SaveValueToFile("update_module_url", "", PATH.AFTER_COMPILE_DATA);
                FileHelper.SaveValueToFile("update_module_url", "", PATH.AFTER_COMPILE_DATA);
            }
        }
Ejemplo n.º 8
0
 public static Gradient GetGradient(Texture texture)
 {
     if (texture != null)
     {
         string gradient_data_string = FileHelper.LoadValueFromFile(texture.name, PATH.GRADIENT_INFO_FILE);
         if (gradient_data_string != null)
         {
             return(Parser.ParseToObject <Gradient>(gradient_data_string));
         }
         return(Converter.TextureToGradient(GetReadableTexture(texture)));
     }
     return(new Gradient());
 }
Ejemplo n.º 9
0
        private static void InitValues()
        {
            string stringData = FileHelper.LoadValueFromFile("drp", ModuleSettings.MODULES_CONFIG);

            if (stringData != null)
            {
                data = Parser.ParseToObject <DRP_Data>(stringData);
            }
            else
            {
                data = new DRP_Data();
            }
            ValuesInit = true;
        }
Ejemplo n.º 10
0
        private static bool LoadModuleLocationData(Module m)
        {
            string data = FileHelper.LoadValueFromFile(m.id, PATH.MODULES_LOCATION__DATA);

            if (string.IsNullOrEmpty(data))
            {
                return(false);
            }
            m.location_data = Parser.ParseToObject <ModuleLocationData>(data);
            if (AssetDatabase.GUIDToAssetPath(m.location_data.guid) == "")
            {
                m.location_data = null;
                return(false);
            }
            return(true);
        }
Ejemplo n.º 11
0
 public static Gradient GetGradient(Texture texture)
 {
     if (texture != null)
     {
         string gradient_data_string = FileHelper.LoadValueFromFile(texture.name, PATH.GRADIENT_INFO_FILE);
         if (gradient_data_string != null)
         {
             Debug.Log(texture.name + " Gradient loaded from file.");
             Gradient g = Parser.Deserialize <Gradient>(gradient_data_string);
             return(g);
         }
         Debug.Log(texture.name + " Converted into Gradient.");
         return(Converter.TextureToGradient(GetReadableTexture(texture)));
     }
     return(new Gradient());
 }
Ejemplo n.º 12
0
        private void InitVariables()
        {
            is_changing_vrc_sdk = (FileHelper.LoadValueFromFile("delete_vrc_sdk", PATH.AFTER_COMPILE_DATA) == "true") || (FileHelper.LoadValueFromFile("update_vrc_sdk", PATH.AFTER_COMPILE_DATA) == "true");

            List <Type> subclasses = typeof(ModuleSettings).Assembly.GetTypes().Where(type => type.IsSubclassOf(typeof(ModuleSettings))).ToList <Type>();

            moduleSettings = new ModuleSettings[subclasses.Count];
            int i = 0;

            foreach (Type classtype in subclasses)
            {
                moduleSettings[i++] = (ModuleSettings)Activator.CreateInstance(classtype);
            }

            is_init = true;

            if (thry_message == null)
            {
                WebHelper.DownloadStringASync(Thry.URL.SETTINGS_MESSAGE_URL, delegate(string s) { thry_message = Parser.ParseToObject <ButtonData>(s); });
            }
        }
Ejemplo n.º 13
0
        private static TextureData LoadTextureSettings(MaterialProperty prop, TextureData predefinedTextureSettings, bool force_texture_options)
        {
            if (force_texture_options && predefinedTextureSettings != null)
            {
                return(predefinedTextureSettings);
            }
            string json_texture_settings = FileHelper.LoadValueFromFile("gradient_texture_options_" + prop.name, PATH.PERSISTENT_DATA);

            if (json_texture_settings != null)
            {
                return(Parser.ParseToObject <TextureData>(json_texture_settings));
            }
            else if (predefinedTextureSettings != null)
            {
                return(predefinedTextureSettings);
            }
            else
            {
                return(new TextureData());
            }
        }
        public static TextureData GetTextureSettings(MaterialProperty prop)
        {
            TextureData defined_default = ThryEditor.currentlyDrawing.currentProperty.options.texture;

            if (ThryEditor.currentlyDrawing.currentProperty.options.force_texture_options && defined_default != null)
            {
                return(defined_default);
            }
            string json_texture_settings = FileHelper.LoadValueFromFile("gradient_texture_options_" + prop.name, PATH.PERSISTENT_DATA);

            if (json_texture_settings != null)
            {
                return(Parser.ParseToObject <TextureData>(json_texture_settings));
            }
            else if (defined_default != null)
            {
                return(defined_default);
            }
            else
            {
                return(new TextureData());
            }
        }
Ejemplo n.º 15
0
 public static string Get(string key)
 {
     return(FileHelper.LoadValueFromFile(key, PATH.PERSISTENT_DATA));
 }