itch.iohttp://itch.iohttps://itch.io/t/2436204/conditionvalidattributeConditionValidAttributehttps://itch.io/t/2436204/conditionvalidattributeMon, 24 Oct 2022 02:16:08 GMTMon, 24 Oct 2022 02:16:08 GMTMon, 24 Oct 2022 02:16:08 GMTDefine 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]

]]>
https://itch.io/t/2419571/instancepolicyattributeInstancePolicyAttributehttps://itch.io/t/2419571/instancepolicyattributeSat, 15 Oct 2022 11:19:59 GMTSat, 15 Oct 2022 11:19:59 GMTSat, 15 Oct 2022 11:19:59 GMTDefine how to handle the instantiation policy of the following situations

  • the none-serializable property
  • property mark with [SerializeReference]


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

  • Default: instantiating the object directly
  • Nullable: null values are allowed, and instantiation can be selected by clicking the button
  • UsingDerived: null values are allowed, and the type of instantiation can be selected by clicking the button
]]>
https://itch.io/t/2417534/valuelimitattributeValueLimitAttributehttps://itch.io/t/2417534/valuelimitattributeFri, 14 Oct 2022 04:04:53 GMTFri, 14 Oct 2022 04:04:53 GMTFri, 14 Oct 2022 04:04:53 GMTAfter 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

]]>
https://itch.io/t/2417530/validateinputattributeValidateInputAttributehttps://itch.io/t/2417530/validateinputattributeFri, 14 Oct 2022 04:01:31 GMTFri, 14 Oct 2022 04:01:31 GMTFri, 14 Oct 2022 04:01:31 GMTAfter the data changes, the result is made by the Validator method and the reminder information is displayed

[ValidateInput(nameof(IsEvenNumber), "Must be even", MessageType.Warning)]
public int Value1;
private bool IsEvenNumber(int i)
{
    return i % 2 == 0;
}
]]>
https://itch.io/t/2417525/toolkitdrawerattributeToolkitDrawerAttributehttps://itch.io/t/2417525/toolkitdrawerattributeFri, 14 Oct 2022 03:59:59 GMTFri, 14 Oct 2022 03:59:59 GMTFri, 14 Oct 2022 03:59:59 GMTLet UnityEngine apply the plugin's Drawer on the properties associated with Attribute

 Often used in the following places

  • Nest Class or Struct
  • Array or list

for more information, please refer to the "Enable ToolkitDrawer" description section

]]>
https://itch.io/t/2417522/titlegroupattributeTitleGroupAttributehttps://itch.io/t/2417522/titlegroupattributeFri, 14 Oct 2022 03:58:35 GMTFri, 14 Oct 2022 03:58:35 GMTFri, 14 Oct 2022 03:58:35 GMTA BoxGroup with Title

[TitleGroup("Group1")]
public int Value1;
[TitleGroup("Group1")]
public int Value2;

For more information, please refer to the "Grouping" description section

]]>
https://itch.io/t/2417518/typeselectattributeTypeSelectAttributehttps://itch.io/t/2417518/typeselectattributeFri, 14 Oct 2022 03:56:43 GMTFri, 14 Oct 2022 03:56:43 GMTFri, 14 Oct 2022 03:56:43 GMTAfter 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);
}

]]>
https://itch.io/t/2417511/treeviewattributeTreeViewAttributehttps://itch.io/t/2417511/treeviewattributeFri, 14 Oct 2022 03:53:47 GMTFri, 14 Oct 2022 03:53:47 GMTFri, 14 Oct 2022 03:53:47 GMTSelect 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

]]>
https://itch.io/t/2417509/tagattributeTagAttributehttps://itch.io/t/2417509/tagattributeFri, 14 Oct 2022 03:51:20 GMTFri, 14 Oct 2022 03:51:20 GMTFri, 14 Oct 2022 03:51:20 GMTUse UIElements TagField to set data

[Tag]
public string Value1;
]]>
https://itch.io/t/2417507/suffixlabelattributeSuffixLabelAttributehttps://itch.io/t/2417507/suffixlabelattributeFri, 14 Oct 2022 03:49:43 GMTFri, 14 Oct 2022 03:49:43 GMTFri, 14 Oct 2022 03:49:43 GMTA label is drawn at the end of the property, can set the size through “Width” and the color through “Color”


[SuffixLabel("Seconds", 60)]
public float Time1;
]]>
https://itch.io/t/2417504/suffixbuttonattributeSuffixButtonAttributehttps://itch.io/t/2417504/suffixbuttonattributeFri, 14 Oct 2022 03:48:05 GMTFri, 14 Oct 2022 03:48:05 GMTFri, 14 Oct 2022 03:48:05 GMTA 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

  • bool Callback1() 
  • void Callback2(bool v)
]]>
https://itch.io/t/2417502/sortinglayerattributeSortingLayerAttributehttps://itch.io/t/2417502/sortinglayerattributeFri, 14 Oct 2022 03:44:50 GMTFri, 14 Oct 2022 03:44:50 GMTFri, 14 Oct 2022 03:44:50 GMTSelect SortingLayer

[SortingLayer]
public int Value1;
]]>
https://itch.io/t/2417500/showpropertyorderattributeShowPropertyOrderAttributehttps://itch.io/t/2417500/showpropertyorderattributeFri, 14 Oct 2022 03:43:26 GMTFri, 14 Oct 2022 03:43:26 GMTFri, 14 Oct 2022 03:43:26 GMTDisplays PropertyOrder next to the Label for debugging sorting use

public int Value3;
[ShowPropertyOrder]
public int Value4;
]]>
https://itch.io/t/2417498/showininspectorattributeShowInInspectorAttributehttps://itch.io/t/2417498/showininspectorattributeFri, 14 Oct 2022 03:41:59 GMTFri, 14 Oct 2022 03:41:59 GMTFri, 14 Oct 2022 03:41:59 GMTEnables 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

]]>
https://itch.io/t/2417496/showifattributeShowIfAttributehttps://itch.io/t/2417496/showifattributeFri, 14 Oct 2022 03:40:10 GMTFri, 14 Oct 2022 03:40:10 GMTFri, 14 Oct 2022 03:40:10 GMTShow the property according to the specified conditions

public bool Switch1;
[ShowIf(nameof(Switch1))]
public int Value1;
]]>
https://itch.io/t/2417491/separatorattributeSeparatorAttributehttps://itch.io/t/2417491/separatorattributeFri, 14 Oct 2022 03:35:37 GMTFri, 14 Oct 2022 03:35:37 GMTFri, 14 Oct 2022 03:35:37 GMTA divider line is displayed above the control and color can set

[Separator("red")]
public int Value1;
 
[Separator]
public int Value2;

Supports property type: int, string

]]>
https://itch.io/t/2417487/sceneattributeSceneAttributehttps://itch.io/t/2417487/sceneattributeFri, 14 Oct 2022 03:33:51 GMTFri, 14 Oct 2022 03:33:51 GMTFri, 14 Oct 2022 03:33:51 GMTScene data selection

[Scene]
public int Value1;

Supports property type: int, string

]]>
https://itch.io/t/2417486/requiredattributeRequiredAttributehttps://itch.io/t/2417486/requiredattributeFri, 14 Oct 2022 03:32:02 GMTFri, 14 Oct 2022 03:32:02 GMTFri, 14 Oct 2022 03:32:02 GMTIf 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

  • object: not null
  • string: not null and not empty
  • valueType: not equals to default value
]]>
https://itch.io/t/2417480/readonlyattributeReadOnlyAttributehttps://itch.io/t/2417480/readonlyattributeFri, 14 Oct 2022 03:30:07 GMTFri, 14 Oct 2022 03:30:07 GMTFri, 14 Oct 2022 03:30:07 GMTMakes the control unmodifiable (disabled)

[ReadOnly]
public int Value1;
]]>
https://itch.io/t/2417477/propertyorderattributePropertyOrderAttributehttps://itch.io/t/2417477/propertyorderattributeFri, 14 Oct 2022 03:27:58 GMTFri, 14 Oct 2022 03:27:58 GMTFri, 14 Oct 2022 03:27:58 GMTModify the sort order of the properties, the smaller the number, the earlier the arrangement

public int Value1;
[PropertyOrder(-1)]
public int Value2;
]]>
https://itch.io/t/2417473/onvaluechangedattributeOnValueChangedAttributehttps://itch.io/t/2417473/onvaluechangedattributeFri, 14 Oct 2022 03:25:35 GMTFri, 14 Oct 2022 03:25:35 GMTFri, 14 Oct 2022 03:25:35 GMTWhen the property changes, the specified method is called

[OnValueChanged(nameof(OnValueChanged1))]
public int Value1;
public int Value2;
protected void OnValueChanged1()
{
    Value2 = Value1 * 2;
}

Note that modifying data in the callback function triggers cyclically

]]>
https://itch.io/t/2417466/minvalueattributeMinValueAttributehttps://itch.io/t/2417466/minvalueattributeFri, 14 Oct 2022 03:21:13 GMTFri, 14 Oct 2022 03:21:13 GMTFri, 14 Oct 2022 03:21:13 GMTAfter the data changes, if the data is out of range, it is automatically corrected to the limited min value

[MinValue(0)]
public int IntMin0;

Limit range supports type: int, float or reference another property Supports property type: int, float, Vector2, Vector3, Vector4, Vector2Int, Vector3Int

]]>
https://itch.io/t/2417462/minmaxsliderattributeMinMaxSliderAttributehttps://itch.io/t/2417462/minmaxsliderattributeFri, 14 Oct 2022 03:19:49 GMTFri, 14 Oct 2022 03:19:49 GMTFri, 14 Oct 2022 03:19:49 GMTUse UIElements MinMaxSliderField to set data

[MinMaxSlider(0.0f, 10.0f)]
public Vector2 Value1;

Supports property type: Vector2

]]>
https://itch.io/t/2417460/maxvalueattributeMaxValueAttributehttps://itch.io/t/2417460/maxvalueattributeFri, 14 Oct 2022 03:17:46 GMTFri, 14 Oct 2022 03:17:46 GMTFri, 14 Oct 2022 03:17:46 GMTAfter the data changes, if the data is out of range, it is automatically corrected to the limited max value

[MaxValue(10)]
public int IntMax10;

Limit range supports type: int, float or reference another property Supports property type: int, float, Vector2, Vector3, Vector4, Vector2Int, Vector3Int

]]>
https://itch.io/t/2417458/maskattributeMaskAttributehttps://itch.io/t/2417458/maskattributeFri, 14 Oct 2022 03:16:28 GMTFri, 14 Oct 2022 03:16:28 GMTFri, 14 Oct 2022 03:16:28 GMTUse UIElements MaskField to select data

[Mask(nameof(DataSource))]
public int IntValue;
 
private static DropdownList DataSource()
{
    var list = new DropdownList();
    list.Add(1, "One");
    list.Add(2, "Two");
    list.Add(4, "Three");
    return list;
}

A data source is required, as described in DropdownAttribute

]]>
https://itch.io/t/2417455/layermaskattributeLayerMaskAttributehttps://itch.io/t/2417455/layermaskattributeFri, 14 Oct 2022 03:14:33 GMTFri, 14 Oct 2022 03:14:33 GMTFri, 14 Oct 2022 03:14:33 GMTUse UIElements LayerMaskField to select data

[LayerMask]
public int IntValue;
]]>
https://itch.io/t/2417449/layerattributeLayerAttributehttps://itch.io/t/2417449/layerattributeFri, 14 Oct 2022 03:12:10 GMTFri, 14 Oct 2022 03:12:10 GMTFri, 14 Oct 2022 03:12:10 GMTUse UIElements LayerField to select data

[Layer]
public int IntValue;

Supports property type: int, string

]]>
https://itch.io/t/2417447/labelattributeLabelAttributehttps://itch.io/t/2417447/labelattributeFri, 14 Oct 2022 03:10:05 GMTFri, 14 Oct 2022 03:10:05 GMTFri, 14 Oct 2022 03:10:05 GMTModify the label of the property display


[Label("Label1")]
public int Value1;
]]>
https://itch.io/t/2417445/infoboxattributeInfoBoxAttributehttps://itch.io/t/2417445/infoboxattributeFri, 14 Oct 2022 03:07:45 GMTFri, 14 Oct 2022 03:07:45 GMTFri, 14 Oct 2022 03:07:45 GMTDisplays an information box above the control

[InfoBox("Message1", Type = MessageType.Info)]
public int Value1;

Can specify a condition that controls whether the information box is displayed

]]>
https://itch.io/t/2417443/hideifattributeHideIfAttributehttps://itch.io/t/2417443/hideifattributeFri, 14 Oct 2022 03:05:51 GMTFri, 14 Oct 2022 03:05:51 GMTFri, 14 Oct 2022 03:05:51 GMTHide the property according to the specified conditions

public bool Switch1;
[HideIf(nameof(Switch1))]
public int Value1;
]]>
https://itch.io/t/2417435/foldoutgroupattributeFoldoutGroupAttributehttps://itch.io/t/2417435/foldoutgroupattributeFri, 14 Oct 2022 03:00:32 GMTFri, 14 Oct 2022 03:00:32 GMTFri, 14 Oct 2022 03:00:32 GMTUse 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

]]>
https://itch.io/t/2417430/folderpathattributeFolderPathAttributehttps://itch.io/t/2417430/folderpathattributeFri, 14 Oct 2022 02:57:40 GMTFri, 14 Oct 2022 02:57:40 GMTFri, 14 Oct 2022 02:57:40 GMTUsed for string fields, provides a selection dialog box for directory paths, and supports drag-and-drop

[FolderPath]
public string Value1;

Instruction:

  • By default, [FolderPath] provides a path relative to the project.Set “AbsolutePath” to true, will provide an absolute path.
  • “ParentFolder” parameter can provide a parent path by default
  • By setting “AbsolutePath” to true, [FolderPath] will provide an absolute path.
  • By setting “RequireExistsPath” to true, you can verify the exists of [FolderPath]. By default, [FolderPath] uses the front slash. It can also be configured to use backslashes via “UseBackslashes”.
]]>
https://itch.io/t/2417426/filepathattributeFilePathAttributehttps://itch.io/t/2417426/filepathattributeFri, 14 Oct 2022 02:55:01 GMTFri, 14 Oct 2022 02:55:01 GMTFri, 14 Oct 2022 02:55:01 GMTUsed for string fields, provides a selection dialog box for file paths, and supports drag-and-drop

[FilePath]
public string Value1;

Instruction:

  • By default, [FilePath] provides a path relative to the project.Set “AbsolutePath“ to true, will provide an absolute path.
  • Set “ParentFolder“ to provide a parent path by default
  • Set “Extensions“ to filter by extension
  • By setting “AbsolutePath“ to true, FolderPath will provide an absolute path.
  • By setting “RequireExistsPath“ to true, you can verify the exists of [FilePath]
  • By default, [FolderPath] uses the front slash. It can also be configured to use backslashes via “UseBackslashes“.
]]>
https://itch.io/t/2417422/enableifattributeEnableIfAttributehttps://itch.io/t/2417422/enableifattributeFri, 14 Oct 2022 02:52:44 GMTFri, 14 Oct 2022 02:52:44 GMTFri, 14 Oct 2022 02:52:44 GMTEnables the control according to the specified conditions


public bool Switch1;
[EnableIf(nameof(Switch1))]
public int Value1;
]]>
https://itch.io/t/2417419/dropdownattributeDropdownAttributehttps://itch.io/t/2417419/dropdownattributeFri, 14 Oct 2022 02:47:48 GMTFri, 14 Oct 2022 02:47:48 GMTFri, 14 Oct 2022 02:47:48 GMTSelect the data using UIElements PopupField

[Dropdown(nameof(FieldDS), refreshButton: true)]
public int Value1;
 
public int[] FieldDS = new int[] { 1, 2, 3 };

 Dropdown's data sources support properties and methods. The method returns data support DropdownList, ICollection, IEnumerable

 Data source method sample

protected DropdownList MethodDS()
{
    return new DropdownList()
    {
      { Vector3.right, "Right" },
      { Vector3.up, "Up" },
      { Vector3.forward, "Forward" }
    };
}

 When the “refreshButton” parameter is True, a “R” button will appear next to the control, and the options in the list can be refreshed after clicking

  When the “refresher” parameter is associated with a property, the options in the list can be refreshed after the refresher property changed

]]>
https://itch.io/t/2417403/disableifattributeDisableIfAttributehttps://itch.io/t/2417403/disableifattributeFri, 14 Oct 2022 02:36:58 GMTFri, 14 Oct 2022 02:36:58 GMTFri, 14 Oct 2022 02:36:58 GMTDisables the control according to the specified conditions

public bool Switch1;
[DisableIf(nameof(Switch1))]
public int Value1;
]]>
https://itch.io/t/2417388/conditioncompareattributeConditionCompareAttributehttps://itch.io/t/2417388/conditioncompareattributeFri, 14 Oct 2022 02:22:16 GMTFri, 14 Oct 2022 02:22:16 GMTFri, 14 Oct 2022 02:22:16 GMTDefine a Data Compare condition

[ConditionCompare("Cond4", nameof(S1), ">", 2)]

 Determine whether the property S1 is greater than 2


CompareType

Property Type

Help

has

Flag Enum

Enum.HasFlag

IComparable

 

>=

IComparable or Equals supported

 

IComparable

 

<=

IComparable or Equals supported

 

!=

Equals supported

 

=, ==

Equals supported

 

  For more information, please refer to the "Condition" description section

]]>
https://itch.io/t/2417382/conditionhasflagattributeConditionHasFlagAttributehttps://itch.io/t/2417382/conditionhasflagattributeFri, 14 Oct 2022 02:19:34 GMTFri, 14 Oct 2022 02:19:34 GMTFri, 14 Oct 2022 02:19:34 GMTDefine a Enum.HasFlag condition

[ConditionHasFlag("F1", nameof(Switch4), EnumFlags.Flag1)]

Determine whether the property Switch4 is HasFlag to EnumFlags.Flag1

For Flags Enum property

For more information, please refer to the "Condition" description section

]]>
https://itch.io/t/2417380/conditionequalsattributeConditionEqualsAttributehttps://itch.io/t/2417380/conditionequalsattributeFri, 14 Oct 2022 02:16:16 GMTFri, 14 Oct 2022 02:16:16 GMTFri, 14 Oct 2022 02:16:16 GMTDefine a equals condition

[ConditionEquals("Cond3", nameof(Switch3), 123)]

Determine whether the property Switch3 is equal to 123

Most major data types and Enum are supported

For more information, please refer to the "Condition" description section

]]>
https://itch.io/t/2417377/conditionorattributeConditionOrAttributehttps://itch.io/t/2417377/conditionorattributeFri, 14 Oct 2022 02:14:54 GMTFri, 14 Oct 2022 02:14:54 GMTFri, 14 Oct 2022 02:14:54 GMTDefine a logical OR condition

[ConditionOr("Cond1", nameof(Switch1), nameof(Switch2))]

The properties Switch1 and Switch2 are logically OR evaluated

For more information, please refer to the "Condition" description section

]]>
https://itch.io/t/2417375/conditionandattributeConditionAndAttributehttps://itch.io/t/2417375/conditionandattributeFri, 14 Oct 2022 02:13:16 GMTFri, 14 Oct 2022 02:13:16 GMTFri, 14 Oct 2022 02:13:16 GMTDefine a logical AND condition

[ConditionAnd("Cond1", nameof(Switch1), nameof(Switch2))]

The properties Switch1 and Switch2 are logically AND evaluated

For more information, please refer to the "Condition" description section

]]>
https://itch.io/t/2417372/buttonattributeButtonAttributehttps://itch.io/t/2417372/buttonattributeFri, 14 Oct 2022 02:11:54 GMTFri, 14 Oct 2022 02:11:54 GMTFri, 14 Oct 2022 02:11:54 GMTDisplays the method as a button, and the user can click to execute the method body

public int Value;
[Button]
protected void Test1()
{
    Value += 1;
}

Runtime supported

]]>
https://itch.io/t/2417368/boxgroupattributeBoxGroupAttributehttps://itch.io/t/2417368/boxgroupattributeFri, 14 Oct 2022 02:09:24 GMTFri, 14 Oct 2022 02:09:24 GMTFri, 14 Oct 2022 02:09:24 GMTUse UIElements Box to organize the properties

For more information, please refer to the "Grouping" description section

]]>
https://itch.io/t/2417365/animationparamattributeAnimationParamAttributehttps://itch.io/t/2417365/animationparamattributeFri, 14 Oct 2022 02:07:18 GMTFri, 14 Oct 2022 02:07:18 GMTFri, 14 Oct 2022 02:07:18 GMTUse the drop-down controls to select the parameters of Animator

public Animator Target;
[AnimatorParam(nameof(Target))]
public int HashValue;

Supports property type: int, string

Supports filtering of AnimatorControllerParameterType

[AnimatorParam(nameof(Target), AnimatorControllerParameterType.Trigger)]
public string NameValue;
]]>