本次测试包含对AssetDatabase.GetDependencies
和EditorUtility.CollectDependencies
这两个获取资源的依赖资源的 API 的测试,以及对于meta
残留对打AssetBundle
的影响。
输入资源路径,例如Assets/Material/demo.mat
,以路径形式返回该资源依赖的资源列表,例如Assets/Texture/demo.jpg
。
这个 API 返回的结果是“错误”的,也就是带残留的。比如某个材质,原本的shader
引用了4个纹理,然后切换其shader
为新的shader
使之只引用一个纹理,这时AssetDatabase.GetDependencies
返回的结果还是4个纹理。