- 在自定义结构体前加 [System.Serializable]
using UnityEngine;
[System.Serializable]
public struct MyStruct
{
public string name;
public Transform trans_Obj;
public bool isOK;
}
- 在创建该结构体的List时在前面加 [SerializeField]
////// MyStruct的列表 /// [SerializeField] public Listlist_MyStruct;



