Пример #1
0
        public static void setSetting(QHierarchySetting setting, List <QTagTexture> tagTextureList)
        {
            string result = "";

            for (int i = 0; i < tagTextureList.Count; i++)
            {
                result += tagTextureList[i].tag + ";" + AssetDatabase.GetAssetPath(tagTextureList[i].texture.GetInstanceID()) + ";";
            }

            setEditorSetting(setting, result);
            settings[(int)setting] = tagTextureList;
            QHierarchy.repaint();
        }
Пример #2
0
        public static void setSetting(QHierarchySetting setting, List <QHierarchyIconType> value)
        {
            string result = "";

            for (int i = 0; i < value.Count; i++)
            {
                result += ((int)value[i]).ToString();
            }

            setEditorSetting(setting, result);
            settings[(int)setting] = value;
            QHierarchy.repaint();
        }
Пример #3
0
        private bool drawTitle(QHierarchySetting foldoutSetting, string title)
        {
            bool foldout = QHierarchySettings.getSetting<bool>(foldoutSetting);

            GUILayout.Space(5);
            Rect rect = EditorGUILayout.GetControlRect(GUILayout.ExpandWidth(true), GUILayout.Height(24));
            rect.width += rect.x * 2 + 1;
            rect.x = 0;
            GUI.Box(rect, "");
            GUILayout.Space(5);

            rect.x = 5;
            rect.y += 4;
            bool newFoldout = EditorGUI.Foldout(rect, foldout, title);
            if (newFoldout != foldout)
            {
                QHierarchySettings.setSetting(foldoutSetting, newFoldout);
            }
            return newFoldout;
        }
Пример #4
0
        private bool drawTitle(QHierarchySetting foldoutSetting, string title)
        {
            bool foldout = QHierarchySettings.getSetting <bool>(foldoutSetting);

            GUILayout.Space(5);
            Rect rect = EditorGUILayout.GetControlRect(GUILayout.ExpandWidth(true), GUILayout.Height(24));

            rect.width += rect.x * 2 + 1;
            rect.x      = 0;
            GUI.Box(rect, "");
            GUILayout.Space(5);

            rect.x  = 5;
            rect.y += 4;
            bool newFoldout = EditorGUI.Foldout(rect, foldout, title);

            if (newFoldout != foldout)
            {
                QHierarchySettings.setSetting(foldoutSetting, newFoldout);
            }
            return(newFoldout);
        }
Пример #5
0
 private static void setEditorSetting(QHierarchySetting setting, float value)
 {
     EditorPrefs.SetFloat(PREFS_PREFIX + setting.ToString("G"), value);
 }
Пример #6
0
 private static void setEditorSetting(QHierarchySetting setting, bool value)
 {
     EditorPrefs.SetBool(PREFS_PREFIX + setting.ToString("G"), value);
 }
Пример #7
0
 private static float getEditorSetting(QHierarchySetting setting, float defaultValue)
 {
     return(EditorPrefs.GetFloat(PREFS_PREFIX + setting.ToString("G"), defaultValue));
 }
Пример #8
0
 private static string getEditorSetting(QHierarchySetting setting, string defaultValue)
 {
     return(EditorPrefs.GetString(PREFS_PREFIX + setting.ToString("G"), defaultValue));
 }
Пример #9
0
 private static bool getEditorSetting(QHierarchySetting setting, bool defaultValue)
 {
     return(EditorPrefs.GetBool(PREFS_PREFIX + setting.ToString("G"), defaultValue));
 }
Пример #10
0
 public static void setSetting(QHierarchySetting setting, float value)
 {
     setEditorSetting(setting, value);
     settings[(int)setting] = value;
     QHierarchy.repaint();
 }
Пример #11
0
 public static T getSetting <T>(QHierarchySetting setting)
 {
     return((T)settings[(int)setting]);
 }