/// <inheritdoc/> protected override void DoBuildMembers() { Array.Resize(ref members, 3); members[0] = ButtonDrawer.Create("Fields", ToggleShowFields, this, InspectorPreferences.Styles.Toolbar); members[1] = ButtonDrawer.Create("Properties", ToggleShowProperties, this, InspectorPreferences.Styles.Toolbar); members[2] = ButtonDrawer.Create("Methods", ToggleShowMethods, this, InspectorPreferences.Styles.Toolbar); }
/// <summary> Creates a new instance of the drawer or returns a reusable instance from the pool. </summary> /// <param name="buttonText"> The text to shown on the button. </param> /// <param name="memberInfo"> LinkedMemberInfo for the class member that the created drawer represents. Can be null. </param> /// <param name="parent"> The parent drawer of the created drawer. Can be null. </param> /// <param name="readOnly"> True if button should be greyed out and not be interactive. </param> /// <returns> The drawer instance, ready to be used. </returns> public static ButtonDrawer Create(string buttonText, LinkedMemberInfo memberInfo, IParentDrawer parent, GUIStyle style = null, bool readOnly = false) { ButtonDrawer result; if (!DrawerPool.TryGet(out result)) { result = new ButtonDrawer(); } result.Setup(GUIContentPool.Create(buttonText), null, memberInfo, parent, null, readOnly, style); result.LateSetup(); return(result); }
/// <inheritdoc/> protected override void DoBuildMembers() { Array.Resize(ref members, 2); var keyToAdd = DrawerProvider.GetForField(Value, keyType, null, this, GUIContent.none, ReadOnly); keyToAdd.OverrideValidateValue = validateKey; keyToAdd.OnKeyboardInputBeingGiven = OnKeyDrawerKeyboardInputBeingGiven; members[0] = keyToAdd; var button = ButtonDrawer.Create("", onAddButtonClicked, this, InspectorPreferences.Styles.AddButton, ReadOnly); members[1] = button; }