Skip to content

Releases: TylerTemp/SaintsField

3.36.3 ShowInInspector Polymorphism Class, Struct & Interface

17 Mar 09:52
Compare
Choose a tag to compare
  1. UI Toolkit: ShowInInspector can now create/edit polymorphism class, struct & interface
  2. UI Toolkit: Fix ShowInInspector losing editing focus when editing an element inside an array/list
  3. Remove the SAINTSFIELD_JETBRAINS_RIDER define by @Insprill in #172
public class GeneralDummyClass: IDummy
{
    public string GetComment()
    {
        return "DummyClass";
    }

    public int MyInt { get; set; }
    public int GenDumInt;
    public string GenDumString;
}

[ShowInInspector] private static IDummy _dummy;

[Button]
private void DebugDummy() => Debug.Log(_dummy);
c-showininspector-interface.mp4

Full Changelog: 3.36.2...3.36.3

3.36.2 ShowInInspector Edit Array/List

14 Mar 10:33
Compare
Choose a tag to compare

UI Toolkit: ShowInInspector can now edit list/array type

using SaintsField;

private class MyClass
{
    public string MyString;
    public GameObject MyObj;
    private MyEnum _myEnum;
}

[ShowInInspector] private Color[] _colors = {Color.red, Color.green, Color.blue};
[ShowInInspector, Ordered] private Color[] _colorEmptyArray;

[Button, Ordered]
private void ArrayChange0ToRed()
{
    _colorEmptyArray[0] = Color.red;
}

[ShowInInspector, Ordered] private MyClass[] _myClasses;
c-showininspector-list.mp4

Full Changelog: 3.36.1...3.36.2

3.36.1 ShowInInspector Editing General Class

14 Mar 03:28
Compare
Choose a tag to compare
  1. UI Toolkit: ShowInInspector can now edit a general class type #170
  2. Button no longer gives "Method is never used" warning if you have jetbrains ide package installed (this package is installed default by Unity) PR by @Insprill
// Please ensure you already have SaintsEditor enabled in your project before trying this example
using SaintsField.Playa;

private class MyClass
{
    public string MyString;
}

[ShowInInspector] private MyClass _myClass;
[ShowInInspector] private MyClass _myClassD = new MyClass
{
    MyString = "Hi",
};
c-showininspector-null.mp4

Full Changelog: 3.36.0...3.36.1

3.36.0 ShowInInspector Editing

13 Mar 10:33
Compare
Choose a tag to compare

Change Log

  1. Allow ShowInInspector to editor in inspector like Odin. (Does not support list/array, dictionary, null-class yet)
  2. ShowInInspector add byte/sbyte type support (PR by @Insprill)
  3. Suppress all compiler warnings of CS0168 & CS0219 caused by preprocessors (PR by @Insprill)
  4. ShowInInspector no longer try to display a property without a getter

New Contributors

Full Changelog: 3.35.1...3.36.0

Image

3.35.1 Auto Getter Bug Fix

12 Mar 09:16
Compare
Choose a tag to compare

Fix auto getters won't apply changes in some cases #161

Full Changelog: 3.35.0...3.35.1

3.35.0 Sub-Field for Rich Label & Show/Hide...-If

11 Mar 08:41
Compare
Choose a tag to compare
  1. Show/Hide/Disable/Endable-If now accept sub-fields.
  2. rich label now support <field />, <field.subField/>, <field.subField=formatControl /> to display the target field's value.
using SaintsField;
[GetComponentInChildren, Expandable] public ToggleSub toggle;

// Show if toggle.requireADescription is a truly value
[ShowIf(nameof(toggle) + ".requireADescription")]
public string description;

// ToggleSub.cs
public class ToggleSub : MonoBehaviour
{
    [LeftToggle] public bool requireADescription;
}
showsubfield.mp4
using SaintsField;

public class SubField : MonoBehaviour
{
    [SerializeField] private string _subLabel;

    public double doubleVal;
}

[Separator("Field")]
// read field value
[RichLabel("<color=lime><field/>")] public string fieldLabel;
// read the `_subLabel` field/function from the field
[RichLabel("<field._subLabel/>"), GetComponentInChildren, Expandable] public SubField subField;
// again read the property
[RichLabel("<color=lime><field.gameObject.name/>")] public SubField subFieldName;

[Separator("Field Null")]
// not found target will be rendered as empty string
[RichLabel("<field._subLabel/>")] public SubField notFoundField;
[RichLabel("<field._noSuch/>"), GetComponentInChildren] public SubField notFoundField2;

[Separator("Formatter")]
// format as percent
[RichLabel("<field=P2/>"), PropRange(0f, 1f)] public float percent;
// format `doubleVal` field as exponential
[RichLabel("<field.doubleVal=E/>")] public SubField subFieldCurrency;
c_fieldtag.mp4

Full Changelog: 3.34.0...3.35.0

3.34.0 SpineAttachmentPicker & DefaultExpand

11 Mar 02:47
Compare
Choose a tag to compare
  1. Add SpineAttachmentPicker to pick an attachment from Spine.

  2. Fix Spine related attributes give an error when a target skeletonData is missing.

  3. Add LayoutCloseHere as a shortcut of [Layout(".", keepGrouping: false), LayoutEnd(".")] to include the current field and then close the last named layout group

    LayoutCloseHere is useful when you're done with your subgroup, but you might add some field later, but at the point you don't have a field to put a LayoutEnd

  4. Add LayoutTerminateHere as a shortcut of [Layout(".", keepGrouping: false), LayoutEnd] to include the current field and then terminate the whole layout group

    LayoutTerminateHere is useful when you're done with your group, and your script is also done here (so nowhere to put EndLayout). Oneday you come back and add some new fields, this attribute can prevent them from being included in the group accidentally.

  5. Add DefaultExpand and ArrayDefaultExpand

  6. Remove defaultExpanded from Table, use ArrayDefaultExpand instead

Full Changelog: 3.33.3...3.34.0

3.33.3 Table Bug Fix & Improvement

10 Mar 03:03
Compare
Choose a tag to compare
  1. UI Toolkit: fix Table add/remove button can not click after version 3.32.0
  2. Table add bool defaultExpanded=false, bool hideAddButton=false, bool hideRemoveButton=false parameters #125

Full Changelog: 3.33.2...3.33.3


(Source: #EricJanicki)

3.33.2 EnumFlags Re-fine

07 Mar 08:37
Compare
Choose a tag to compare
  1. Change the layout of EnumFlags so it can handle a large enum without displaying a super long list
  2. Breaking Changes: AutoExpanded is removed from EnumFlags
c_enum_flags.mp4

Full Changelog: 3.33.1...3.33.2

3.33.1 Bug Fix & Improvement for SaintsDictionary

06 Mar 02:44
Compare
Choose a tag to compare
  1. Add constructors for SaintsDictionary<,> so it can be created exactly like a standard c-sharp Dictionary<,>
  2. If the key/value for SaintsDictionary<,> is a general class/struct already with a custom drawer, use that drawer rather than flat it.
  3. Fix SaintsDictionary<,> can not detect the serialized field when inherited

Full Changelog: 3.33.0...3.33.1