转自 https://www.csdn.net/tags/MtTacg3sNDg2MDAtYmxvZwO0O0OO0O0O.html
.asset配置文件继承自ScriptableObject
当在界面中需要可视化时需要[System.Serializable]标签
[CreateAssetMenu(fileName = "ABConfig", menuName = "CreatABConfig", order = 0)] public class ABConfig : ScriptableObject { public List<string> m_AllPrefabPath = new List<string>(); public List<FileDirABName> m_AllFileDirAB = new List<FileDirABName>(); [System.Serializable] public struct FileDirABName { public string ABName; public string Path; } }
在工程中右键create->CreatABConfig就可以创建一个ABConfig.asset文件
上面的代码中FileDirABName有标签【System.Serializable】-> m_AllFileDirAB的具体数据是可视化状态,如果去掉此标签则不能看到