-
AssetDatabase.FindAssets
AssetDatabase.GUIDToAssetPath
AssetDatabase.GetDependenciesstring[] pathArray = new string[] { “Assets/Prefabs” };
string[] ss = AssetDatabase.FindAssets(“t:Prefab”, pathArray);//这个方法的第一个参数是 通过什么进行搜索,可以是name 名字 也可以通过标签 标签的话 需要用“l:”进行搜索(不过笔者试了好像没有效果) 也可以通过类型 添加” t:“ 第二个参数其实就是路径,限制查找的路径
Debug.Log(ss.Length);//得到的是资源的GUID
foreach (var item in ss)
{
string path = AssetDatabase.GUIDToAssetPath(item);//得到的是物体的完整路径
string[] str = AssetDatabase.GetDependencies(path);//获取物体的所有的依赖项
Debug.Log(“GUID:”+ item+“path:”+path);
}
AssetDatabase.GetAllAssetBundleNames();//获取所有的AssetBundle的包名
AssetDatabase.RemoveAssetBundleName(“cube”, true);//第一个参数是包名
AssetDatabase.GetAssetPathsFromAssetBundle(); //里面参数填assetBundle 的名称