Releases: TylerTemp/SaintsField
3.9.0 Draw Arrow
- UI Toolkit: Add
SaintsArrow
to draw arrows in the scene (IMGUI support will be added later) - UI Toolkit: Fix auto-getters that get looped calls when changing orders in an array/list
[SerializeField, GetComponent, DrawLabel("Entrance"),
// connect this to worldPos[0]
SaintsArrow(end: nameof(worldPos), endIndex: 0, endSpace: Space.Self),
] private GameObject entrance;
[
// connect every element in the list
SaintsArrow(color: EColor.Green, startSpace: Space.Self, headLength: 0.1f),
// connect every element to the `centerPoint`
SaintsArrow(start: nameof(centerPoint), color: EColor.Red, startSpace: Space.Self, endSpace: Space.Self, headLength: 0.1f, colorAlpha: 0.4f),
PositionHandle(space: Space.Self),
DrawLabel("$" + nameof(PosIndexLabel), space: Space.Self),
]
public Vector3[] worldPos;
[DrawLabel("Center", space: Space.Self), PositionHandle(space: Space.Self)] public Vector3 centerPoint;
[DrawLabel("Exit"), GetComponentInChildren(excludeSelf: true), PositionHandle,
// connect worldPos[0] to this
SaintsArrow(start: nameof(worldPos), startIndex: -1, startSpace: Space.Self),
] public Transform exit;
private string PosIndexLabel(Vector3 pos, int index) => $"[{index}]\n{pos}";
Unity_vaByBYYfDJ.mp4
Full Changelog: 3.8.0...3.9.0
3.8.0 PositionHandle & Bug Fix
- Add
PositionHandle
which can change position of target field in scene view. The target can be either aGameObject
, aComponent
, or a Vector2/Vector3 target. - IMGUI: fix
DrawLabel
won't disappear when you select away - UI Toolkit: fix auto-getters might get looped calls in list/array
- UI Toolkit: fix
AnimatorParam
can't display the correct label withRichLabel
DrawLabel
now support to draw a label for aVector2
orVector3
field withSpace
argumentAnimatorState
now supportAnimatorOverrideController
[PositionHandle, DrawLabel(nameof(worldPos3))] public Vector3 worldPos3;
[PositionHandle, DrawLabel(nameof(worldPos2))] public Vector2 worldPos2;
[PositionHandle(space: Space.Self), DrawLabel(nameof(localPos3), space: Space.Self)] public Vector3 localPos3;
[PositionHandle(space: Space.Self), DrawLabel(nameof(localPos2), space: Space.Self)] public Vector2 localPos2;
position-vector.mp4
[PositionHandle, DrawLabel("$" + nameof(LabelName)), GetComponentInChildren(excludeSelf: true)]
public MeshRenderer[] meshChildren;
private string LabelName(MeshRenderer target, int index) => $"{target.name}[{index}]";
Unity_doYpdP7D8u.mp4
Full Changelog: 3.7.2...3.8.0
3.7.2 Button With IEnumerator
- UI Toolkit: All the buttons now support
Coroutine
. If the target function returns anIEnumerator
, the button will start a coroutine and wait for it to finish. - UI Toolkit: Fix
ProgressBar
won't display updated value if the value is changed externally. - UI Toolkit: Fix
PlayaInfoBox
won't hide whenshow
returnsfalse
private bool _uploading;
[ProgressBar(100)]
[ShowIf(nameof(_uploading))]
[ReadOnly]
public int processDisplay;
[Ordered, Button("Upload"), PlayaHideIf(nameof(_uploading))]
private IEnumerator UploadAndGetExcel()
{
processDisplay = 0;
_uploading = true;
_complete = false;
foreach (int progress in Enumerable.Range(0, 100))
{
processDisplay = progress;
yield return null;
}
_uploading = false;
_complete = true;
}
[LayoutShowIf(nameof(_complete))]
[Layout("InfoBox", ELayout.Horizontal)]
[Ordered, PlayaBelowInfoBox("Upload Completed.")]
private bool _complete;
[Layout("InfoBox")]
[Ordered, Button("OK")]
private void UploadCompleteOk() => _complete = false;
NVIDIA_Share_u5GdOdh8AR.mp4
Full Changelog: 3.7.0...3.7.2
3.7.0 Toggle Entire Layout Group
- Add
LayoutShowIf
,LayoutHideIf
,LayoutEnableIf
,LayoutDisableIf
to toggle show/enable status of an entire layout group. #100, #73 - Fix auto getter accesses disposed property in some cases in
SaintsEditor
using SaintsField.Playa;
public bool editableMain;
public bool visibleMain;
[LayoutEnableIf(nameof(editableMain))]
[LayoutShowIf(nameof(visibleMain))]
[LayoutStart("Main", ELayout.FoldoutBox)]
public bool editable1;
public bool visible1;
[LayoutEnableIf(nameof(editable1))]
[LayoutShowIf(nameof(visible1))]
[LayoutStart("./1", ELayout.FoldoutBox, marginBottom: 10)]
public int int1;
public string string1;
[LayoutStart("..")]
public bool editable2;
public bool visible2;
[LayoutEnableIf(nameof(editable2))]
[LayoutShowIf(nameof(visible2))]
[LayoutStart("./2", ELayout.FoldoutBox)]
public int int2;
public string string2;
layout-toggle-video.mp4
Full Changelog: 3.6.1...3.7.0
3.6.1 Bug Fix & Auto Getter Improvement
- IMGUI: Fix accessing disposed
SerializedProperty
, #102 - IMGUI: Split config for auto getters from UI Toolkit, and change the default behavior of IMGUI auto getters to be never update while on inspector (same as old behavior of auto getters). Might be related to #98
- IMGUI: Fix
RichLabel
has some indent and truncate issue withLeftToggle
andResiziableTextArea
- Fix Auto Getters won't work if you disabled the update
- UI Toolkit: Remove some unnecessary call to improve some performance
- UI Toolkit: Now scene view will notice you if there is an auto-getter signed a value to a field.
Full Changelog: 3.6.0...3.6.1
3.6.0 Bug Fix, Config Improvement & Handle
- Fix auto getters
includeInactive
checked thegameObject
itself is enabled, but should beactiveInHierarchy
, #103. - Add
DrawLabel
handle to draw labels in the scene view, #95 - Improve the logic of how
SaintsField Config
is loaded to reduce the config loading times. - UI Toolkit: fix auto-getters won't work if you completely disable the update loop.
Since this version, we start to use semantic versioning
for version numbering.
Full Changelog: 3.5.2...3.6.0
3.5.2 Bug Fix
- Fix multiple auto getters on a same field will cause partly filled values.
- Add
bool delayedSearch = false
forListDrawerSettings
to delay the search until you hit enter or blur the search field
Full Changelog: 3.5.1...3.5.2
3.5.1 Performance Improvement for Auto Getters
-
Performance improvement, mainly for UI Toolkit, and partly for IMGUI, #98
-
SaintsFieldConfig
adddelay
andupdate interval
for auto getters so you can have better control over it.It's recommended to set
delay
to 100 andupdate interval
0 (means disabled), because usually you'll not need to frequently check the resources. Everytime clicking on the target will do an update, which is enough for most cases.
Full Changelog: 3.5.0...3.5.1
3.5.0 OnValueChanged UI Toolkit improvement
WARNING: For UI Toolkit, the change might break the OnValueChanged
attributes. See the number 3 below about how to use the old behavior if you face issues.
-
UI Toolkit: Fix an issue with
MinMaxSlider(free: true)
that the high/low is jump back to code value when you input an out-ranged value, then slide back to in-range value -
Fix
Button
won't work if there are two methods with the same name (but different arguments overload) in the same class, #104 -
UI Toolkit: Fix
OnValueChanged
won't get triggered when aSerializeReference
field is changed, #97Known Issue:
Unity changed how the
TrackPropertyValue
andRegisterValueChangeCallback
works. Using on aSerializeReference
, you can still get the correct callback, but the callback will happen multiple times for one change.Using
OnValueChanged
on an array/list ofSerializeReference
/Serializable
can cause some problem when you add/remove an element: theConsole
will give error, and the inspector view will display incorrect data. Selecting out then selecting back will fix this issue.
However, you can just switch back to the old way if you do not care about the field change in the reference field, (Because Unity, still, does not fix related issues about property tracking...) by clickingWindow
-Saints
-Create or Edit SaintsField Config
and change the config here.These two issues can not be fixed unless Unity fixes it. This is very depended on what Unity version you're using.
-
SaintsEditor
: AddOnArraySizeChanged
to watch the array size change, #97
Full Changelog: 3.4.12...3.5.0
P.S.