If there is a need to use AI for assistant work (For example, taking a name) during the creative process, the "Talk to AI" function can be used.
Choose the menu "Tool" ->"Talk to AI" to open the interface and interact with AI through chat.
Define a Test of validity condition
[ConditionValid("Cond4", nameof(S1), "notempty")]
Determine whether the property S1(string) is not null and not empty
TestType | Property Type | Help |
empty | string | IsNullOrEmpty |
notempty | string | not IsNullOrEmpty |
null | class object | ==null |
notnull | class object | != null |
<none> | anything | string: not IsNullOrEmpty class object: not null ValueType(struct): not equals to default value |
For more information, please refer to the "Condition" description section
[v1.3]
Define how to handle the instantiation policy of the following situations
public interface INestClass { } public class NestClass1 : INestClass { public int Value; } [ShowInInspector] [InstancePolicy(InstancePolicyAttribute.PolicyType.Nullable)] public NestClass1 NC; [SerializeReference] [InstancePolicy(InstancePolicyAttribute.PolicyType.UsingDerived)] public INestClass NestInterface;
PolicyType
After the data changes, if the data is out of range, it is automatically corrected to the limited value
[ValueLimit(0, 2)] public int Value_0_2;
Limit range supports type: int, float or reference another property
Reference sample
public bool[] ArrayData; [ValueLimit(0, nameof(ArrayData))] public int LimitIndex;
Supports property type: int, float, Vector2, Vector3, Vector4, Vector2Int, Vector3Int
After entering the keyword, use the Enter key to activate the selection box,then select to set the System.Type data
[TypeSelect] public string StringValue;
“System.Type” and “string” data type are supported
TypeSelect can specify the data source for the selection box by setting “DataSource”. data sources support properties and methods. The method returns data support DropdownList, ICollection, IEnumerable
Data source method sample
private static IEnumerable<Type> DataSource() { yield return typeof(int); yield return typeof(bool); }
TypeSelect can specify a Type file by setting “Filter”.
The filter method is defined as bool Filter(Type type, string input).
Filter method sample
private static bool DataFilter(Type type, string input) { return type.Name.Contains(input); }
Select the data using UIElements TreeView (Unity 2021.1 or later)
[TreeView(nameof(Data), true)] public int TreeValue1; private TreeViewNode Data() { var root = new TreeViewNode(); root.Add(1, "Node1"); root.Add(2, "Node2"); var n3 = root.Add(3, "Node3"); n3.Selectable = false; n3.Add(4, "Level1"); n3.Add(5, "Level2"); root.Add(6, "Node4"); return root; }
TreeView's data sources support properties and methods that return a value of TreeViewNode
When the “refreshButton” parameter is True, a “R” button will appear next to the control, and the tree nodes can be refreshed after clicking
When the “refresher” parameter is associated with a property, the tree nodes can be refreshed after the refresher property changed
A Button is drawn at the end of the property, can set the size through “Width”
[SuffixButton("DebugLog", nameof(Check))] public int Button1; private void Check() { Debug.Log(Button1); }
The button can be set to Toggle mode, set the associated property or method through “Callback”
[SuffixButton("T1", nameof(Check1), Toggle = true)] public int Toggle1; private bool m_Checked; private bool Check1() { m_Checked = !m_Checked; Debug.Log("Check1=" + m_Checked); return m_Checked; }
The following definitions are supported for associative methods
Enables a field or property that does not support serialization to be displayed on the Inspector. Other Attributes can also act on this property
[Separator("blue")] [ShowInInspector] private int NoSerializaedField;
In fact, most Attributes have the role of ShowInInspectorAttribute and don't need to be set up deliberately
If the property is not set, a message is displayed
[Required] public string Value1; [Required] public int Value2; [Required("Must select one", MessageType.Warning)] public Transform Value3;
“Set” judgment is made based on different data types
Use UIElements Foldout to organize the properties
[FoldoutGroup("Group2", ScopeType = GroupScopeType.ScopeBegin)] public float Value3; public float Value3_2; [FoldoutGroup("Group2", ScopeType = GroupScopeType.ScopeEnd)] public float Value5;
For more information, please refer to the "Grouping" description section
Used for string fields, provides a selection dialog box for directory paths, and supports drag-and-drop
[FolderPath] public string Value1;
Instruction: