[Unity, notes] Display structure in Inspector, serialization of structure

In the Inspector in Unity, basic data types and arrays can be displayed directly, but the created structure cannot be displayed directly.

Adding a property to a struct System.Serializablemakes it visible in the Inspector.

[Serializable]
struct CustomData
{
    
    
    public int SomeInteger;
    public string SomeString;
}

Guess you like

Origin blog.csdn.net/m0_46555380/article/details/132603584