让自定义的数据结构可序列化,并可以在inspector中显示使用[System.Serializable]:
[System.Serializable]
public struct AttackEffect
{
public int meleeID;
public GameObject effect;
}
让非public属性序列化并显示在inspector中,使用属性[SerializeField]:
[SerializeField]
private int i7;
让public属性不显示在inspector中,使用属性[HideInInspector]:
[HideInInspector]
public int p1;
dictionary定义的结构不会显示在inspector中。
更多说明这篇文章里比较详细:
http://blog.csdn.net/fg5823820/article/details/8526812
或者原创地址:http://blog.sina.com.cn/s/blog_5b6cb9500101857b.html