Пример #1
0
    static void ReadScriptableObjectAsset()
    {
        AssetSerializeCfg cfg = AssetDatabase.LoadAssetAtPath <AssetSerializeCfg>("Assets/TestAssets.asset");

        Debug.Log(cfg.Id);
        Debug.Log(cfg.Name);
    }
Пример #2
0
    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");
    }