Skip to content

Releases: TylerTemp/SaintsField

3.9.0 Draw Arrow

15 Dec 08:00
Compare
Choose a tag to compare
  1. UI Toolkit: Add SaintsArrow to draw arrows in the scene (IMGUI support will be added later)
  2. 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

12 Dec 14:32
Compare
Choose a tag to compare
  1. Add PositionHandle which can change position of target field in scene view. The target can be either a GameObject, a Component, or a Vector2/Vector3 target.
  2. IMGUI: fix DrawLabel won't disappear when you select away
  3. UI Toolkit: fix auto-getters might get looped calls in list/array
  4. UI Toolkit: fix AnimatorParam can't display the correct label with RichLabel
  5. DrawLabel now support to draw a label for a Vector2 or Vector3 field with Space argument
  6. AnimatorState now support AnimatorOverrideController
[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

09 Dec 13:22
Compare
Choose a tag to compare
  1. UI Toolkit: All the buttons now support Coroutine. If the target function returns an IEnumerator, the button will start a coroutine and wait for it to finish.
  2. UI Toolkit: Fix ProgressBar won't display updated value if the value is changed externally.
  3. UI Toolkit: Fix PlayaInfoBox won't hide when show returns false
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

08 Dec 09:38
Compare
Choose a tag to compare
  1. Add LayoutShowIf, LayoutHideIf, LayoutEnableIf, LayoutDisableIf to toggle show/enable status of an entire layout group. #100, #73
  2. 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

04 Dec 10:28
Compare
Choose a tag to compare
  1. IMGUI: Fix accessing disposed SerializedProperty, #102
  2. 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
  3. IMGUI: Fix RichLabel has some indent and truncate issue with LeftToggle and ResiziableTextArea
  4. Fix Auto Getters won't work if you disabled the update
  5. UI Toolkit: Remove some unnecessary call to improve some performance
  6. UI Toolkit: Now scene view will notice you if there is an auto-getter signed a value to a field.

image

Full Changelog: 3.6.0...3.6.1

3.6.0 Bug Fix, Config Improvement & Handle

29 Nov 14:58
Compare
Choose a tag to compare
  1. Fix auto getters includeInactive checked the gameObject itself is enabled, but should be activeInHierarchy, #103.
  2. Add DrawLabel handle to draw labels in the scene view, #95
  3. Improve the logic of how SaintsField Config is loaded to reduce the config loading times.
  4. 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

26 Nov 13:08
Compare
Choose a tag to compare
  1. Fix multiple auto getters on a same field will cause partly filled values.
  2. Add bool delayedSearch = false for ListDrawerSettings 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

24 Nov 11:07
Compare
Choose a tag to compare
  1. Performance improvement, mainly for UI Toolkit, and partly for IMGUI, #98

  2. SaintsFieldConfig add delay and update interval for auto getters so you can have better control over it.

    It's recommended to set delay to 100 and update 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

22 Nov 17:05
Compare
Choose a tag to compare

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.

  1. 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

  2. Fix Button won't work if there are two methods with the same name (but different arguments overload) in the same class, #104

  3. UI Toolkit: Fix OnValueChanged won't get triggered when a SerializeReference field is changed, #97

    Known Issue:

    Unity changed how the TrackPropertyValue and RegisterValueChangeCallback works. Using on a SerializeReference, you can still get the correct callback, but the callback will happen multiple times for one change.

    Using OnValueChanged on an array/list of SerializeReference/Serializable can cause some problem when you add/remove an element: the Console 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 clicking Window - 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.

    See: 1, 2

  4. SaintsEditor: Add OnArraySizeChanged to watch the array size change, #97

Full Changelog: 3.4.12...3.5.0


P.S.

3.4.12 Fix for Old Unity

13 Nov 09:40
Compare
Choose a tag to compare

Fix for Unity < 2021.3

Full Changelog: 3.4.11...3.4.12


P.S.