private static void _GetDependenciesBy(string type, bool directlyDepend = false) { string[] selections = Selection.assetGUIDs; List <string> assetPathDependenciesBy = new List <string>(); for (int i = 0; selections != null && i < selections.Length; ++i) { string path = AssetDatabase.GUIDToAssetPath(selections[i]); assetPathDependenciesBy.AddRange(GetDependenciesBy(path, type, directlyDepend)); } ShowSelectedObjectsTool.ShowSelectedObjectsInProjectBrowser <UnityEngine.Object>(assetPathDependenciesBy); }
private static void _GetDependencies <T>(bool directlyDepend = false) where T : UnityEngine.Object { string[] selections = Selection.assetGUIDs; List <string> lstPathNames = new List <string>(); List <string> assetPathDependenciesBy = new List <string>(); for (int i = 0; selections != null && i < selections.Length; ++i) { lstPathNames.Add(AssetDatabase.GUIDToAssetPath(selections[i])); } #if UNITY_5 assetPathDependenciesBy.AddRange(AssetDatabase.GetDependencies(lstPathNames.ToArray(), !directlyDepend)); #else assetPathDependenciesBy.AddRange(AssetDatabase.GetDependencies(lstPathNames.ToArray()); #endif ShowSelectedObjectsTool.ShowSelectedObjectsInProjectBrowser <T>(assetPathDependenciesBy); }
private static void _GetDependencies(string type) { string[] selections = Selection.assetGUIDs; List <string> lstPathNames = new List <string>(); List <string> assetPathDependenciesBy = new List <string>(); for (int i = 0; selections != null && i < selections.Length; ++i) { lstPathNames.Add(AssetDatabase.GUIDToAssetPath(selections[i])); } assetPathDependenciesBy.AddRange(AssetDatabase.GetDependencies(lstPathNames.ToArray())); for (int i = assetPathDependenciesBy.Count - 1; i >= 0; --i) { if (!assetPathDependenciesBy[i].ToLower().EndsWith(type)) { assetPathDependenciesBy.RemoveAt(i); } } ShowSelectedObjectsTool.ShowSelectedObjectsInProjectBrowser <UnityEngine.Object>(assetPathDependenciesBy); }