Extend VisualElement and IStyle fluent extensions#33
Merged
Conversation
Add raw-enum overloads for all StyleEnum<T> setters, conditional *If variants for child management methods, XML documentation for new methods, and fix SetMinSize parameter naming bug.
- Add BaseFieldExtensionsSetLabel overloads for 25 Unity types (Quaternion, AnimationCurve, Bounds, Color, Vector2/3/4, etc.) and reorganize into BaseFields/ subdirectory - Extend IStyle, VisualElement.Style, VisualElement.Child, VisualElement.Uss, INotifyValueChanged, and list/tree view extensions with new fluent methods - Add editor extensions: IBindable, PropertyField, EnumFlagsField; rename Unbind to UnbindFrom for consistency with BindTo - Add Math-assembly SetValue extensions for float2/3/4, int2/3/4 types
Correct SetLabel type count from 25 to 29 and add two missing Fixed entries: FocusableExtensions null-safety and StyleSheet resource loading null-guard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SetLabeloverloads forBaseField<T>covering 29 Unity types (Quaternion,AnimationCurve,Bounds,Color,Vector2/3/4,int,float,string, etc.) and reorganize intoBaseFields/subdirectoryStyleEnum<T>setters onIStyleExtensionsandVisualElementExtensions.Style(e.g.SetFlexWrap(Wrap)alongsideSetFlexWrap(StyleEnum<Wrap>))*Ifvariants (AddChildIf,InsertChildIf,AddChildrenIf,InsertChildrenIf) for all child management methods across all collection typesINotifyValueChanged,IStyle,BaseListView,MultiColumnListView,MultiColumnTreeView,Button,Focusable,Manipulators,ProgressBarwith new fluent methodsSetValueextensions forfloat2/3/4,int2/3/4typesSetLabelforPropertyField,SetBindingPathforIBindable; tightenBindPropertyToconstraint towhere T : VisualElement, IBindable; renameUnbind→UnbindFromfor consistency withBindToSetMinSizeparameter naming bug (maxHeight→minHeight), null-safety inFocusableExtensions.IsFocus, and null-guard inAddStyleSheetsFromResource/RemoveStyleSheetsFromResourceNotes for review
SetFlexDirectionhas two overloads:StyleEnum<FlexDirection>(new) andFlexDirection(existing) — these are intentionally distinct signatures, not duplicates.Plugins.metadeletion andProjectSettings.assetchange are minor Unity project housekeeping included in the PR.