static void ReadScriptableObjectAsset() { AssetSerializeCfg cfg = AssetDatabase.LoadAssetAtPath <AssetSerializeCfg>("Assets/TestAssets.asset"); Debug.Log(cfg.Id); Debug.Log(cfg.Name); }
static void CreateScriptableObjectAsset() { AssetSerializeCfg asetSerializecfg = ScriptableObject.CreateInstance <AssetSerializeCfg>(); asetSerializecfg.Id = 1; asetSerializecfg.Name = "ceshi"; asetSerializecfg.TestList = new List <string>() { "aa", "ww" }; AssetDatabase.CreateAsset(asetSerializecfg, "Assets/TestAssets.asset"); }