Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

CatyboyStudio

56
Posts
51
Topics
7
Followers
44
Following
A member registered Jun 26, 2022 · View creator page →

Creator of

Recent community posts

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.


AI Story Generator community » HowToUse · Created a new topic Index
(2 edits)

Talk to AI

Since the time of the new package is uncertain, can you put various types of raw material into the package? I can complete the missing parts according to the article

Good job, But as your article says, the following layer parts are missing  (Bottom and Top of layer 1,3,4,5,7,8) 

great! BUY it all

need enemy, villain and monster

(2 edits)

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]

[SerializeReference]

By default, both UnityBuilder and ToolBuilder do not process property with this Attribute, You need to do the following coding

[SerializeReference]
[InstancePolicy(InstancePolicyAttribute.PolicyType.UsingDerived)]
public ActorType Actor;
(1 edit)

Define 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

Say what you want to say

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 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;
}

Let 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

A BoxGroup with Title

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

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

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

Use UIElements TagField to set data

[Tag]
public string Value1;

A 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;

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

  • bool Callback1() 
  • void Callback2(bool v)

Select SortingLayer

[SortingLayer]
public int Value1;

Displays PropertyOrder next to the Label for debugging sorting use

public int Value3;
[ShowPropertyOrder]
public int Value4;

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

Show the property according to the specified conditions

public bool Switch1;
[ShowIf(nameof(Switch1))]
public int Value1;

A 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

Scene data selection

[Scene]
public int Value1;

Supports property type: int, string

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

  • object: not null
  • string: not null and not empty
  • valueType: not equals to default value

Makes the control unmodifiable (disabled)

[ReadOnly]
public int Value1;

Modify the sort order of the properties, the smaller the number, the earlier the arrangement

public int Value1;
[PropertyOrder(-1)]
public int Value2;

When 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

After 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

Use UIElements MinMaxSliderField to set data

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

Supports property type: Vector2

After 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

Use 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

Use UIElements LayerMaskField to select data

[LayerMask]
public int IntValue;

Use UIElements LayerField to select data

[Layer]
public int IntValue;

Supports property type: int, string

Modify the label of the property display


[Label("Label1")]
public int Value1;

Displays 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

Hide the property according to the specified conditions

public bool Switch1;
[HideIf(nameof(Switch1))]
public int Value1;

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:

  • 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”.