Exemple #1
0
        public static void GUI(EditorObject info)
        {
            EditorGUI.indentLevel = info.level;

            if (info.editorList != null)
            {
                EditorList.GUI(info.editorList);
            }
            else if (info.editorArray != null)
            {
                EditorArray.GUI(info.editorArray);
            }
            else if (info.editorDictionary != null)
            {
                EditorDictionary.GUI(info.editorDictionary);
            }
            else if (info.editorClass != null)
            {
                EditorClass.GUI(info.editorClass);
            }
            else
            {
                object value = info.objectData.GetValue();

                bool isChange = false;

                InputTool.Input(info.objectData.type, info.name, ref value, ref isChange);

                if (isChange)
                {
                    info.objectData.SetValue(value);
                }
            }
        }
Exemple #2
0
 void RefreshValue()
 {
     if (objectData.listData != null)
     {
         if (editorList == null)
         {
             editorList = new EditorList(objectData.listData, level + 1);
         }
         else
         {
             editorList.RefreshValue(objectData.listData);
         }
     }
     else if (objectData.arrayData != null)
     {
         if (editorArray == null)
         {
             editorArray = new EditorArray(objectData.arrayData, level + 1);
         }
         else
         {
             editorArray.RefreshValue(objectData.arrayData);
         }
     }
     else if (objectData.dictionaryData != null)
     {
         if (editorDictionary == null)
         {
             editorDictionary = new EditorDictionary(objectData.dictionaryData, level + 1);
         }
         else
         {
             editorDictionary.RefreshValue(objectData.dictionaryData);
         }
     }
     else if (objectData.classData != null)
     {
         if (editorClass == null)
         {
             editorClass = new EditorClass(objectData.classData, level + 1, false, name);
             editorClass.GetEditorField();
         }
         else
         {
             editorClass.RefreshValue(objectData.classData);
         }
     }
 }
        public static void GUI(EditorDictionary info)
        {
            EditorGUI.indentLevel = info.level;

            info.isFold = EditorGUILayout.Foldout(info.isFold, info.dictionaryData.name);
            if (info.isFold == false)
            {
                return;
            }

            info.RefreshValue();

            foreach (var item in info.editorElements)
            {
                EditorObject.GUI(item.Key);
                EditorObject.GUI(item.Value);
            }
        }