Unity使用AssetDatabase.CreateAsset报错:Couldn't create asset file!
·
使用AssetDatabase.CreateAsset(UnityEngine.Object asset, string path)新建资源时:
路径path使用:application .datapath +"/xxx/xxx",实际路径会是“E:/asdf/asdfasdf/Assets/xxx/xxx”,这样就会报错“Couldn't create asset file!”
如下图:
![]()
正确path应该使用相对Asset的路径,比如:"Assets/xxx/xxx"
更多推荐



所有评论(0)