示例#1
0
        private static void LoadHiddenHeaderNames()
        {
            string data = PersistentData.Get("HiddenHeaderNames");

            if (data == null)
            {
                headerHiddenSaved = new Dictionary <string, bool>();
            }
            else
            {
                headerHiddenSaved = Parser.Deserialize <Dictionary <string, bool> >(data);
            }
        }
示例#2
0
        public static void SetHidden(ShaderHeader header, bool set_hidden, bool save = true)
        {
            bool contains = headerHiddenSaved.ContainsKey(header.materialProperty.name);

            if (!contains || (contains && headerHiddenSaved[header.materialProperty.name] != set_hidden))
            {
                headerHiddenSaved[header.materialProperty.name] = set_hidden;
                header.is_hidden = set_hidden;
                if (save)
                {
                    PersistentData.Set("HiddenHeaderNames", Parser.Serialize(headerHiddenSaved));
                }
            }
        }
示例#3
0
        private static void LoadHiddenHeaderNames()
        {
            string data = PersistentData.Get("HiddenHeaderNames");

            if (data == null)
            {
                headerHiddenSaved = new Dictionary <string, bool>();
            }
            else
            {
                headerHiddenSaved = Parser.Deserialize <Dictionary <string, bool> >(data);
            }
            data = PersistentData.Get("HeaderHiderState");
            if (data == null)
            {
                state = HeaderHidingType.simple;
            }
            else
            {
                state = (HeaderHidingType)Enum.Parse(typeof(HeaderHidingType), data);
            }
        }
        private void InitInstalledSDKVersionAndPaths()
        {
            string[] guids  = AssetDatabase.FindAssets("version");
            string   path   = null;
            string   u_path = null;

            foreach (string guid in guids)
            {
                string p = AssetDatabase.GUIDToAssetPath(guid);
                if (p.Contains("VRCSDK/version"))
                {
                    path = p;
                }
                if (p.Contains("Udon/version"))
                {
                    u_path = p;
                }
            }
            if (path == null || !File.Exists(path))
            {
                return;
            }

            sdk_information.local_sdk_path = Regex.Match(path, @".*\/").Value;
            if (u_path != null)
            {
                sdk_information.udon_path = Regex.Match(u_path, @".*\/").Value;
            }
            string persistent = PersistentData.Get("vrc_sdk_version");

            if (persistent != null)
            {
                sdk_information.installed_version = persistent;
            }
            else
            {
                sdk_information.installed_version = Regex.Replace(FileHelper.ReadFileIntoString(path), @"\n?\r", "");
            }
        }
示例#5
0
 private static void SetType(HeaderHidingType newstate)
 {
     state = newstate;
     PersistentData.Set("HeaderHiderState", state.ToString());
 }