Пример #1
0
        static bool Draw(List <object> values, GUIContent content)
        {
            EditorGUILayout.BeginVertical();

            var listName = content.text;
            var prevPath = InspectorUtility.Path;

            InspectorUtility.AddFolder(listName);

            var changed = false;

            EditorGUILayout.BeginHorizontal();
            var foldout = InspectorUtility.DrawTabAndFoldout(content);
            var added   = false;
            var deleted = false;

            changed = DrawAddDelete(0, ref added, ref deleted, false);
            if (changed)
            {
                InspectorUtility.Foldout(true);
            }
            EditorGUILayout.EndHorizontal();

            if (changed == false && foldout)
            {
                var tmpValues = new List <object>(values);
                for (int i = 0; i < tmpValues.Count; ++i)
                {
                    changed |= DrawElement(tmpValues, i);
                }
            }

            InspectorUtility.Path = prevPath;
            EditorGUILayout.EndVertical();
            return(changed);
        }
Пример #2
0
 public static void Expand()
 {
     InspectorUtility.Foldout(true, null, InspectorUtility.SelectedPath);
 }
Пример #3
0
 public static void CollapseAll()
 {
     InspectorUtility.Foldout(false, null, InspectorUtility.SelectedPath, true);
 }