/// <inheritdoc/> protected internal override void Initialize(int layoutIndex) { GUILayout arrayLayout = layout.AddLayoutY(layoutIndex); listGUIField = InspectableListGUI.Create(parent, title, path, property, arrayLayout, depth); listGUIField.IsExpanded = parent.Persistent.GetBool(path + "_Expanded"); listGUIField.OnExpand += x => parent.Persistent.SetBool(path + "_Expanded", x); }
/// <summary> /// Creates a new inspectable list GUI object that displays the contents of the provided serializable property. /// </summary> /// <param name="parent">Parent Inspector this field belongs to.</param> /// <param name="title">Label to display on the list GUI title.</param> /// <param name="path">Full path to this property (includes name of this property and all parent properties). /// </param> /// <param name="property">Serializable property referencing a list.</param> /// <param name="layout">Layout to which to append the list GUI elements to.</param> /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple /// nested containers whose backgrounds are overlaping. Also determines background style, /// depths divisible by two will use an alternate style.</param> public static InspectableListGUI Create(Inspector parent, LocString title, string path, SerializableProperty property, GUILayout layout, int depth) { InspectableListGUI listGUI = new InspectableListGUI(parent, title, path, property, layout, depth); listGUI.BuildGUI(); return(listGUI); }
/// <inheritdoc/> protected override GUILayoutX CreateGUI(GUILayoutY layout) { InspectableListGUI listParent = (InspectableListGUI)parent; SerializableProperty property = GetValue <SerializableProperty>(); string entryPath = listParent.Path + "[" + SeqIndex + "]"; field = CreateInspectable(listParent.Inspector, SeqIndex + ".", entryPath, 0, Depth + 1, new InspectableFieldLayout(layout), property, new InspectableFieldStyleInfo()); return(field.GetTitleLayout()); }
/// <summary> /// Creates a new inspectable list GUI object that displays the contents of the provided serializable property. /// </summary> /// <param name="parent">Parent Inspector this field belongs to.</param> /// <param name="title">Label to display on the list GUI title.</param> /// <param name="path">Full path to this property (includes name of this property and all parent properties). /// </param> /// <param name="property">Serializable property referencing a list.</param> /// <param name="layout">Layout to which to append the list GUI elements to.</param> /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple /// nested containers whose backgrounds are overlaping. Also determines background style, /// depths divisible by two will use an alternate style.</param> public static InspectableListGUI Create(Inspector parent, LocString title, string path, SerializableProperty property, GUILayout layout, int depth) { InspectableListGUI listGUI = new InspectableListGUI(parent, title, path, property, layout, depth); listGUI.BuildGUI(); return listGUI; }