-
Add
ELayout
shortcut:TitleBox
=Background | Title | TitleOut
FoldoutBox
=Background | Title | TitleOut | Foldout
CollapseBox
=Background | Title | TitleOut | Collapse
And improve the appearance for UI Toolkit with foldout/collapse + title.
-
UI Toolkit:
Layout
now have some space with fields -
Fix drawer fallback not work for array/list
-
Fix possible property disposed access
-
UI Toolkit: Improved
AdvancedDropdown
position -
Fix
ListDrawerSettings
error when searching a enum field -
ListDrawerSettings
now can search the child field when the target is aScriptableObject
- Fix
EnableIf
not work with Value Comparison - Fix #42 GetComponent etc need better error handling and report
- Fix callback won't fill null parameter value when the value of the target is null
- Deprecated
PlayaArraySize
. Just useArraySize
instead. - Fix
SaintsInterface
drawer did not work inside array. - #45: Now
GetComponent*
works with array/list, and will be auto filled if you haveSaintsEditor
enabled. - UI Toolkit: Fix
AdvancedDropdown
out of screen.
Value Comparison for Show/Hide/Enable/Disable-If
Now the string can have !
prefix to negate the comparison.
And ==
, !=
, >
etc. suffix for more comparison you want.
AssetPreview
now will load the preview of thegameObject
if the target is aComponent
. Useful when you use a script type to reference a prefab.- Fix
SaintsInterface
won't work when T is a super class of ScriptableObject. - Breaking Changes:
ISaintsArray
has been removed, useIWrapProp
instead. - Now most decorators can be used on
SaintsArray
,SaintsList
andSaintsInterface
. - Now
Dropdown
andAdvancedDropdown
supports struct value too. - Add document for
SaintsArray
,SaintsRow
about custom drawer.
- Fixed:
AssetPreview
should not destroy the texture and lead to empty image. - UI Toolkit: Better
ELayout.TitleOut
with foldout mode for[Layout]
. - Add
ListDrawerSettings
to search and paging a large list/array.
- Layout system now have
LayoutGroup
,LayoutEnd
to quickly group many fields together. - DOTweenPlay tools now have
DOTweenPlayGroup
,DOTweenPlayEnd
to quickly group many DOTweenPlay methods together. - Layout now use the last config for the target group, this is useful when you want to inherent but want to change config of parent's Layout group.
Note: This version re-worked the layout system and might break the existing functions. Report a bug if you face any issues.
UI Toolkit: Fix #35 float [MinMaxSlider]
read min value to max value when using input rather than slider.
- (by @Lx34r) Fix foldout display error with tab in Layout Attribute #33
- Fix #34 that Unity will dispose the serialized property first before destroy the drawer, leading to errors when drawer is in an array and the target element gets removed.
Button
now allows to have parameters and you can change the value in inspector.- If you have
DOTween
installed without ASMDEF enabled, there will be a popup window to ask you either enable it, or disable SaintsField's DOTween ability.
SaintsInterface
for serializing interface of a UnityEngine.Object
type (or sub type).
Special thanks for @dbc's answer in stackoverflow
Fix in some Unity version (tested on 2022.3.20) a cached struct object can not correctly report the value inside it after changing #29
- Fix
ResourcePath
not work onScriptableObject
- UI Toolkit: fix
Layer
won't save the changed value #28
SaintsEditor
now haveOnEvent
to bind a method to your customUnityEvent
- Fix fallback system broken on generic types #27
SaintsEditor
now have OnButtonClick
to bind a method to a button click event.
Fix can not check if a type is a subclass of another generic type, and failed to use the custom drawer. #23
- IMGUI now can fallback to CustomPropertyDrawer of data type (previously only PropertyAttribute drawer)
- Add
DOTween
detect usingDOTWEEN
marco added byDOTween
when setup - UI Toolkit: Fix
DOTweenPlay
,ParticlePlay
button on Unity before 2022.2 which usesunityBackgroundScaleMode
ShowInInspector
now support to show array/list- Fix
ShowInInspector
and some other SaintsEditor tool might not find the correct target in some case (especially insideSaintsRow
)
- UI Toolkit: fix
DecoratorDrawer
get drawn more than once. - Add
Enum
support forShowIf
/HideIf
/EnableIf
/DisableIf
/PlayaShowIf
/PlayaHideIf
/PlayaEnableIf
/PlayaDisableIf
- Improve
SaintsArray
so it works more like an actual array.
- UI Toolkit: fix
AddressableAdress
broken since 3.0.0 - UI Toolkit: fix dropdown button incorrect layout (
Dropdown
,AdvancedDropdown
,AddressableAdress
etc) - UI Toolkit: allow buttons to wrap if
EnumFlags
has both theAutoExpand
andDefaultExpand
asfalse
- UI Toolkit: fix
NavMeshAreaMask
incorrect label align. - Addressable tools now can open addressable groups edit window.
- AnimatorParams now can open the animator edit window.
- Fix
AnimatorParams
for integer type.
- UI Toolkit: Fix
SaintsEditor
"Script" field not aligned - Fix Issue 20 that
EnumFlags
check contains for mixed bits, and flip bits when toggling a mixed bit. - UI Toolkit: fix
EnumFlags
layout issue.
-
Completely rewrite UI Toolkit components with
"unity-base-field__aligned"
class. Since this version, UI Toolkit will no longer have the weird label width issue.The
UI Toolkit Label Width Fix
function is now disabled and removed. -
TryFixUIToolkit
inSaintsEditor
is now deprecated. -
[UIToolkit]
(used for label width fixing) attribute is now deprecated -
ShowAboveImage
/ShowBelowImage
now useFieldStart
as default align. -
IMGUI: fix
PlayaRichLabel
forSaintsRow
-
UI Toolkit: fix
ShowInInspector
won't update values for non-serialized fields -
UnsaintlyEditor
is removed
-
Since this version, UI Toolkit now can property fallback to
CustomPropertyDrawer
of a custom type (previously it only supports to fallback to customPropertyAttribute
drawer).Note: this feature is only for UI Toolkit. IMGUI does not support this feature.
Note: combining with
RichLabel
, UI Toolkit will find the firstunity-label
class label which in some case might not be correct. This feature can not be turned off yet. Please report issue if you face any problem. -
SaintsList
/SaintsArray
fix working withRichLabel
, fix deep nesting rendering issue.
- Add
PlayaRichLabel
for array label modification. - Fix callback for
OnChanged
,RichLabel
etc. sometimes can not get a correct callback parameter filled.
- Add
SaintsArray
,SaintsList
for nested array/list serialization. - IMGUI: Change the logic of how rich text is rendered when the text is long.
- Fix
AnimatorStateChanged
not excluded Editor fields.
- Add
ParticlePlay
- Remove a forgotten log in
SaintsEditor
UI Toolkit. - Add
PlayaArraySize
which can deal with 0 length array/list.
- Add
ArraySize
- UI Toolkit: Fix
ShowInInspector
for property that the equal operation is incorrect and repeatedly destroy and create elements. Fix a UI Toolkit weird bug that can not update values. - UI Toolkit: Fix
EnumFlags
icons not display.
- IMGUI: Fixes #9 a typo that breaks the
AnimatorState
.
- Fixes #9
AnimatorState
won't work for sub-state machines. AnimatorState
now allow class/struct with satisfied fields.- Fix
AnimatorState
can not property display an error when the target is not found, or the target has no controller. AnimatorState
now has aEdit {yourAnimatorController}...
option to directly open the animator controller.
-
Fix
AssetPreview
incorrect time to destroy the preview texture. -
UI Toolkit: Fix
Dropdown
giving error when working withRichLabel
. -
Allow
EnumFlags
to be expanded withDisabled
state. -
IMGUI: Fix
EnumFlags
sometimes need click more than once to expand -
IMGUI:
ReadOnly
(DisabledIf
etc) now disable the whole field rather than the value field only. -
Expandable
now works properly withReadOnly
(DisabledIf
etc):- The toggle will never be disabled
- IMGUI: The field will be disabled accordingly. (In UI Toolkit they will not be disabled because of the limitation from Unity)
- UI Toolkit: fix labelWidth didn't get fixed unless you change the layout (e.g. resize the inspector)
- UI Toolkit: fix
AdvancedDropdown
didn't display a label because of last version's fix. - UI Toolkit:
AdvancedDropdown
now use the width of the full field. - UI Toolkit:
AdvancedDropdown
now hide breadcrumbs if it's not a nested list, thus it looks more like a normal dropdown when you use it as a searchable dropdown. - Custom object picker now share the same preview scales between all instances, making it feels more like the Unity's default picker.
- Custom object picker preview panel now have a background color to distinct it from the select area.
- Custom object picker search field now have a "clean" button. Due to some IMGUI limitation, clicking it will make the input field LOSE focus.
Fix the UI Toolkit buggy label width, finally!
- UIToolkit: when using a long label, the label will take more space (rather than be truncated in the previous version). Now it behaves the same as UI Toolkit components.
Scene
attribute now have a "Edit Scenes In Build..." option to directly open the "Build Settings" window where you can change building scenes.InputAxis
attribute now have a "Open Input Manager..." option to directly open "Input Manager" tab from "Project Settings" window where you can change input axes.SortingLayer
attribute now have a "Edit Sorting Layers..." option to directly open "Sorting Layers" tab from "Tags & Layers" inspector where you can change sorting layers.
As the most bothering issue fixed in UIToolkit, I'm now removing "experimental" from UIToolkit support. If you face any issue, please submit in Github Issue Page.
Considering the following labels with UI Toolkit enabled:
public string itsALongRideForPeopleWhoHaveNothingToThinkAbout;
public string aBitLongerThanDefault;
public string s; // short
By default (or with PropertyField
from UI Toolkit), Unity display it as this (it's a IMGUI style even with UI Toolkit on):
Now, let's apply any UI Toolkit component (except PropertyField
), it will (surprisingly!) use the modern UI Toolkit flavor label layout:
This inconsistency can make your inspector looks sooooooo weird and very funny because of un-aligned fields. This problem is reported to Unity but never got fixed. Considering:
// default field with UI Toolkit, Unity will truncate it to IMGUI width, instead of UI Toolkit flavor
public string thereIsSomeGoodNewsForPeopleWhoLoveBadNews;
// UI Toolkit component! Unity will grow the space like UI Toolkit
[UIToolkit] public string weWereDeadBeforeTheShipEvenSank;
// another default, Unity will use the IMGUI style width (some mix of a percent, min-width and caculation result) instead of UI Toolkit
public string myString;
// another UI Toolkit component! Unity will use the UI Toolkit style width (120px) like UI Toolkit
[UIToolkit] public string myUiToolkit;
The field indent is a mess, even you're sticking to the UI Toolkit inspector:
This issue is so difficult to solve, that even OdinInspector does not try to fit it. (Or maybe they just don't care...?)
SaintsField now use some trick to make PropertyField
label behaves much more like the vanilla UI Toolkit component:
That means:
- Label will by default get 120px width, which is UI Toolkit's default
- The space gets grow to fix the label when the label gets longer, which is also UI Toolkit's default
- If you have a very looooong label, the value field will be shrank out of view. This is also how UI Toolkit works.
- Add
[Conditional("UNITY_EDITOR")]
for attributes so it won't be included in your build. - Fix example scene will break the build (if you import it in your project).
- Fix
InfoBox
can not get correct callback when it's nested inside an array. - Add
ResourcePath
to get a string path of a resource which allows you to specific required types, and have a custom object picker.
Rate
: no longer frozen the first star if the range starts from 1.- UIToolkit
MinMaxSlider
: incorrect update min/max value when there is an error. - Fix
EnumFlags
IMGUI incorrect height result because Unity will give width=1 during rendering IMGUI for the first time... FixEnumFlags
incorrect field type checking and did not work insideSerializable
. - Fix
Rate
,PropRange
(IMGUI) do not immediately update the value when it's inside aSerializable
.
- Add
RequireType
. This attribute allow you to specify the required component or interface for a field. FieldType
now has a custom object picker window. By default Unity disallow to see an asset with a specific type because of "performance consideration". Ironically, if you directly use a component type instead of aGameObject
, Unity WILL show a correct asset picker. As this can not be "hacked" or "tricked" to let Unity show the correct picker, the custom object picker will allow you to pick a object (e.g. a prefab) with the component you want.
- Fix Issue 8 that most attributes in
SaintsField
did NOT looking for the inherited parent target... This includesPropRange
,Min
,Max
,Dropdown
,AdvancedDropdown
,SpriteToggle
,MaterialToggle
,ColorToggle
,RichLabel
,Above/BelowRichLabel
,InfoBox
, Buttons etc. - Fix
Dropdown
andAdvancedDropdown
incorrect parent finding which may lead to incorrect dropdown items. - Most callbacks now can receive the value of the target field. Allowing a suitable required/optional parameter in the callback to make it work.
This update does not break existing APIs, but greatly changed internal logic of property/method finding, so it's a minor version bump.
Special thanks to ZeroUltra to find this important issue.
- Fix issue 7: when Unity uses
NativeProperty
to inject property with native code and serialized property,serializedObject
will still give correct serialized fields, but reflection will not work, makingSaintsEditor
failed to display some fields. - Remove default
SaintsEditor
for example scene, so people who imports it (most likely when usingunitypackage
) won't accidentally getSaintsEditor
enabled for the whole project. - Fix a bug that possibly break
rate
in some situation. - IMGUI: fix
SaintsEditor
display an emptyMonoScript
when the target is neitherMonoBehavior
norScriptableObject
.
- IMGUI: Fix
SaintsRow
incorrect renderer cache when inside a list. - Fix
ReadOnly
will disable the field when there is an error in your callbacks. - Add
EMode
forReadOnly
,EnableIf
,DisableIf
,ShowIf
,HideIf
to specific if editor is playing or not. - Breaking Changes:
ReadOnly
,EnableIf
,DisableIf
,ShowIf
,HideIf
no longer support directValue and groupBy parameters. SaintsEditor
: AddPlayaDisableIf
,PlayaEnableIf
,PlayaShowIf
,PlayaHideIf
- Fix Issue 3 Texture2D can not be destroyed on a GC calling.
- UI Toolkit: Fix Issue 2 incorrect readonly.
- Fix
HideIf
inconsistent logic of being opposite ofShowIf
. - Add
EnableIf
,DisableIf
- Add
SaintsRow
forSerializable
class/struct to draw Button/Layout/DOTweenPlay for the target field. - Fix
AboveImage
/BelowImage
gives error instead of display nothing when the SpriteRenderer/Image/RawImage does not have a sprite.
RichLabel
,AboveRichLabel
,BelowRichLabel
,OverlayRichLabel
,PostFieldRichLabel
now can receive the value and/or the index (if it's in a list/array) in the callback function.- IMGUI: fix incorrect height on first time rendering.
OnChanged
now can receive the changed value in the callback.- Fix string value incorrect truly check for
ValudateInput
andInfoBox
InfoBox
now will disappear if the callback function returns null as content.- Fix
InfoBox
gives error instead of display nothing when the content is null. - Fix
AboveImage
/BelowImage
gives error instead of display nothing when the SpriteRenderer/Image/RawImage does not have
- IMGUI: Fix PropertyField not with
includeChildren: true
and lead to brokenReferencePicker
ValidateInput
now can receive the value and/or the index (if it's in a list/array) in the callback function.
- Fix
MinMaxSlider
incorrect step. - Fix
ProgressBar
set value is not in real-time in struct type. - UI Toolkit: Fix incorrect image align for
AsssetPreview
,AboveImage
,BelowImage
- UI Toolkit: Fix
LeftToggle
not apply the value.
- UI Toolkit: Fix
MinMaxSlider
incorrect clamp. - UI Toolkit: Fix
MinMaxSlider
difficult to manually input a value because of auto-correction.
- A better parser for
AdvancedDropdown
. Now you can use/
to define a sub item. - UI Toolkit: dropdown icon for
AdvancedDropdown
looks better now. - Fix readme about
FindComponent
ValidateInput
now support validation callback with parameter of the target field value.SaintsEditor
fix a button rendered twice if it's override (or usenew
) in a derived class.SaintsEditor
,ShowInInspector
now will change appearance when value changed for auto property.SaintsEditor
,ShowInInspector
now support to shownull
value with a yellow background.
- Add
NavMeshAreaMask
to select NavMesh area bitmask for Unity's AI Navigation. - Add
NavMeshArea
to select NavMesh area as name, value or bitmask. - Fix a weird issue that
SaintsEditor
might not find the correctMonoScript
in Unity 2021
- Add
GetComponentInParent
/GetComponentInParents
ValidateInput
now also support forbool
result.ValidateInput
now will continuously validate the input rather than check on value changed.- Fix
<label/>
not work in rich text when working with NaughtyAttributes.
Add GetComponentByPath
. Now you can auto sign a component with hierarchy by path, with index filter support.
SaintsEditor
now supports Layout (Foldout, Tab, GropBox, TitledBox etc) to group several fields together- Fix incorrect width condition check for UI Toolkit when trying to fix Unity's labelWidth issue.
- Breaking Changes: rename
UnsaintlyEditor
toSaintsEditor
SatinsEditor
now supportsDOTweenPlay
to preview DOTween without entering play mode- Add
Windows/Saints
menu for quick function toggle - Breaking Changes: rename
InfoBox
'scontentIsCallback
toisCallback
- Breaking Changes: General Buttons rename parameter
buttonLabelIsCallback
toisCallback
- General Buttons now will use function name as label when you omit the
buttonLabel
parameter
- Fix
Addressable
broken on last code refactor - UI Toolkit: Fix
Addressable
picker out of view when the item is long
- IMGUI: Fix
DecoratorDrawer
got drawn more than once because Unity changes the behavior ofPropertyField
in 2022.1+ - IMGUI: Fix
Texture2D
resize for Unity 2021.1
- IMGUI: Fix
Expandable
foldout overlap with label, Issue#1 - IMGUI: Fix
Expandable
may fail when expand a Unity component - IMGUI: Fix
ReadOnly
did not haveEditorGUI.BeginDisabledGroup
andEditorGUI.EndDisabledGroup
in pair
- Fix
Required
not work on nested case. Remove the limitation on int/float - Fix many attributes didn't find correct parent object and failed on some cases
- IMGUI: Fix incorrect height for
InfoBox
- Fix incorrect height when you manually disable UI Toolkit
- IMGUI: Fix
Expandable
not fold/expand correctly on array/list - Fix incorrect texture scale function
- Fix
AssetPreview
won't scale up when give a bigger width/height value - Change
AssetPreview
's parameters:maxWidth
->width
,maxHeight
->height
- UI Toolkit: Fix
AboveImage
/BelowImage
has empty frame space when scale down
Add ReferencePicker
for Unity's SerializeReference
- Fix
Dropdown
has not sub item for/
in UI Toolkit Dropdown
Allow to disable/
as a sub item
- Add
AdvancedDropdown
for UI Toolkit - Fix a issue that when select a value from dropdown, the value is changed internally, but will get actually applied only when you finish inspect current object (like, to inspect another object, close Unity, etc)
- Change the logic of finding resources
- Add
ProgressBar
- Fix
RichLable(null)
not work in IMGUI after the UI Toolkit refactor - Fix
IMGUI
PropertyScope
not disposed issue - Add color
charcoalGray
,oceanicSlate
- Fix scene out of boundary when you remove a scene from build list
- (UI Toolkit) Expandable use
InspectorElement
so it can use a custom editor if you have one - (UI Toolkit) Change all
Toggle
drawer to useRadioButton
component - (UI Toolkit) Fix
CurveRange
won't allow to setm_CurveColor
by script - No longer disable IMGUI functions when UI Toolkit is active, to allow Unity (or your custom inspector) to use UI Toolkit or IMGUI when you have both available.
- When using UI Toolkit mixed with default field with no drawer, now you can add
[UIToolkit]
soSaintsField
will try to align the label width the same way as UI Toolkit does. UnsaintlyEditor
will try to fix the label width issue when using UI Toolkit. If you're usingUnsaintlyEditor
, you do not need the[UIToolkit]
attribute.
UI Toolkit supports are experimental, you can disable it by adding a custom marco SAINTSFIELD_UI_TOOLKIT_DISABLE
Fix UI Toolkit breaks old Unity versions.
- Fix
GameObjectActive
won't save after change active state. - Experimental: support for UI Toolkit (Unity 2022.2+ uses UI Toolkit by default)
- Fix
UnsaintlyEditor
incorrect fields order.
- Add
FindComponent
- Add
ButtonAddOnClick
- Add
UnsaintlyEditor
- No longer need
read/write
enabled when using a picture as icon AboveImage
/BelowImage
now will try to get the image from the field when noname
is given- Change how the scale of
AssetPreview
handled
- Add
CurveRange
- Add
AdvancedDropdown
- Fix
EColor.Green
incorrect color present - Allow
SAINTSFIELD_ADDRESSABLE_DISABLE
macro to disableAddressable
related attributes
- Now we supports Unity
2019.1+
! - Add
AddressableLabel
. This only works if you haveAddressable
installed in your project. - Add
AddressableAddress
. This only works if you haveAddressable
installed in your project. - Add
GetScriptableObject
Expandable
now can be used on anything that is serializable as long as the target can use used bySerializedObject
, no longer limited toScriptableObject
.- Fix
Expandable
background covers the fields on Unity 2019. <color>
label now use the same color as Unity Rich Label plus some extra colors.- Fix
clear
color inRichLabel
actually got white color. - Colors name is now case insensitive in
RichLabel
.
AnimatorParam
no longer offersnull
valueAnimatorParam
andAnimatorState
now will try to find theanimator
on current object if the name ofanimator
is not set- Use standard field picker for
layer
andtag
- Add
LeftToggle
- Fix a issue that when using
Scene
with a string without default value, it would display the first item but the actually value is null or empty string. Now it will sign the first value on it. - Fix a issue that
Scene
will display empty when your scene name starts with an underscore.
- Fix indent for
Expandable
- Add
GetComponentInChildren
- Add
GetComponent
- Add
GetComponentInScene
- Add
GetPrefabWithComponent
- Add
AddComponent
- Fix
AboveImage
andBelowImage
won't scale if the target image is not readable/writeable - Fix
AboveImage
andBelowImage
scale logic - Rename
Range
toPropRange
- Fix a bug that the space below the field is calculated incorrectly
- Allow for list/array field
RichLabel
no longer draw a background- Massive fix for callbacks that did not use the parent container as the target
- Fix image cached logic for
AssetPreview
andAboveImage
/BelowImage
- Fix
Dropdown
when you put it on a field of astruct
- Now you can use
RichLabel
to override child field of an array/list
The core of how Attribute
s are discovered is now changed. This version should be compatible with old ones, but in case I pumped the minor version number to 1
.
- Add
EnumFlags
- Fix a issue that
OnValueChanged
will get called when no change happens at all.
- Add
AboveImage
,BelowImage
- Add
EAlign
forAssetPreview
- Fix scale for
AssetPreview
- Add
Range
- Fix an issue that editor scripts will get build and lead to a build error
- Add
OverlayRichLabel
- Add
PostFieldRichLabel
Add InputAxisAttribute
- Add
RateAttribute
for rating stars. - Fix
ValidateInputAttribute
won't call the validator the first time it renders. - Fix an indent issue