コード例 #1
0
        /// <inheritdoc/>
        protected internal override void Initialize(int layoutIndex)
        {
            GUILayout arrayLayout = layout.AddLayoutY(layoutIndex);

            arrayGUIField            = InspectableArrayGUI.Create(parent, title, path, property, arrayLayout, depth, style);
            arrayGUIField.IsExpanded = parent.Persistent.GetBool(path + "_Expanded");
            arrayGUIField.OnExpand  += x => parent.Persistent.SetBool(path + "_Expanded", x);
        }
コード例 #2
0
            /// <summary>
            /// Creates a new inspectable array 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 single-dimensional array.</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>
            /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
            public static InspectableArrayGUI Create(Inspector parent, LocString title, string path,
                                                     SerializableProperty property, GUILayout layout, int depth, InspectableFieldStyleInfo style)
            {
                InspectableArrayGUI guiArray = new InspectableArrayGUI(parent, title, path, property, layout, depth, style);

                guiArray.BuildGUI();

                return(guiArray);
            }
コード例 #3
0
            /// <inheritdoc/>
            protected override GUILayoutX CreateGUI(GUILayoutY layout)
            {
                InspectableArrayGUI  arrayParent = (InspectableArrayGUI)parent;
                SerializableProperty property    = GetValue <SerializableProperty>();

                string entryPath = arrayParent.Path + "[" + SeqIndex + "]";

                field = CreateInspectable(arrayParent.Inspector, SeqIndex + ".", entryPath, 0, Depth + 1,
                                          new InspectableFieldLayout(layout), property);

                return(field.GetTitleLayout());
            }
コード例 #4
0
            /// <inheritdoc/>
            protected override GUILayoutX CreateGUI(GUILayoutY layout)
            {
                InspectableArrayGUI  arrayParent = (InspectableArrayGUI)parent;
                SerializableProperty property    = GetValue <SerializableProperty>();

                InspectableFieldStyleInfo styleInfo = arrayParent.Style.Clone();

                styleInfo.StyleFlags &= ~InspectableFieldStyleFlags.NativeWrapper;

                string entryPath = arrayParent.Path + "[" + SeqIndex + "]";

                field = CreateInspectable(arrayParent.Inspector, SeqIndex + ".", entryPath, 0, Depth + 1,
                                          new InspectableFieldLayout(layout), property, styleInfo);

                return(field.GetTitleLayout());
            }