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

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

            bool isChange = false;

            int size = info.arrayData.Count;

            InputTool.InputInt("Size", ref size, ref isChange);
            if (isChange)
            {
                info.arrayData.SetCount(size);
            }

            info.RefreshValue();

            for (int i = 0; i < size; i++)
            {
                EditorObject.GUI(info.editorElements[i]);
            }
        }
Example #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);
         }
     }
 }