[MenuItem("Assets/查找选中资源依赖关系",false, 0)]
public static void FindDependencies()
{
foreach (var guid in Selection.assetGUIDs)
{
string path = AssetDatabase.GUIDToAssetPath(guid);
foreach (var dependenciePath in AssetDatabase.GetDependencies(path, false))
{
if(path != dependenciePath && !dependenciePath.Contains("cs"))
Debug.LogError(string.Format("path = {0} 依赖 > {1}", path, dependenciePath));
}
}
Debug.Log("查找依赖结束");
}
[MenuItem("Assets/查找选中资源反向依赖关系", false, 1)]
public static void FindReverseDependencies()
{
Dictionary<string, List<string>> dDependencies = new Dictionary<string, List<string>>();
foreach (var guid in Selection.assetGUIDs)
{
string t = AssetDatabase.GUIDToAssetPath(guid);