|
|
@@ -34,11 +34,27 @@ namespace Dissonance.Inspector |
|
|
|
Debug.Log("AssetInspector Log dump\n[" + string.Join(",\n", filelines) + "]"); |
|
|
|
} |
|
|
|
|
|
|
|
public static void Log<T>(AssetBundle assetBundle) where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
Instance[] instances = Inspect<T>(assetBundle); |
|
|
|
string[] filelines = new string[instances.Length]; |
|
|
|
for (int i = 0; i < instances.Length; i++) |
|
|
|
{ |
|
|
|
filelines[i] = instances[i].ToString() + ","; |
|
|
|
} |
|
|
|
Debug.Log("AssetInspector Log dump\n[" + string.Join(",\n", filelines) + "]"); |
|
|
|
} |
|
|
|
|
|
|
|
public static void LogNames<T>() where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
Debug.Log(string.Join("\n", InspectNames<T>())); |
|
|
|
} |
|
|
|
|
|
|
|
public static void LogNames<T>(AssetBundle assetBundle) where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
Debug.Log(string.Join("\n", InspectNames<T>(assetBundle))); |
|
|
|
} |
|
|
|
|
|
|
|
public static void LogAll() |
|
|
|
{ |
|
|
|
Log<UnityEngine.Object>(); |
|
|
@@ -60,14 +76,25 @@ namespace Dissonance.Inspector |
|
|
|
File.WriteAllLines(filename, filelines); |
|
|
|
} |
|
|
|
|
|
|
|
public static void Dump<T>(string filename, AssetBundle assetBundle) where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
Instance[] instances = Inspect<T>(assetBundle); |
|
|
|
string[] filelines = new string[instances.Length]; |
|
|
|
for (int i = 0; i < instances.Length; i++) |
|
|
|
{ |
|
|
|
filelines[i] = instances[i].ToString() + ","; |
|
|
|
} |
|
|
|
File.WriteAllLines(filename, filelines); |
|
|
|
} |
|
|
|
|
|
|
|
public static void DumpNames<T>(string filename) where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
File.WriteAllLines(filename, InspectNames<T>()); |
|
|
|
} |
|
|
|
|
|
|
|
public static void DumpAll(string filename) |
|
|
|
public static void DumpNames<T>(string filename, AssetBundle assetBundle) where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
Dump<UnityEngine.Object>(filename); |
|
|
|
File.WriteAllLines(filename, InspectNames<T>(assetBundle)); |
|
|
|
} |
|
|
|
|
|
|
|
public static void DumpNamesAll(string filename) |
|
|
@@ -75,32 +102,51 @@ namespace Dissonance.Inspector |
|
|
|
DumpNames<UnityEngine.Object>(filename); |
|
|
|
} |
|
|
|
|
|
|
|
public static void DumpNamesAll(string filename, AssetBundle assetBundle) |
|
|
|
{ |
|
|
|
DumpNames<UnityEngine.Object>(filename, assetBundle); |
|
|
|
} |
|
|
|
|
|
|
|
public static Instance[] Inspect<T>() where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
if (allBundles == null) Init(); |
|
|
|
List<Instance> allInstances = new List<Instance>(); |
|
|
|
foreach (var b in allBundles) |
|
|
|
{ |
|
|
|
UnityEngine.Object[] assets = b.LoadAllAssets<T>(); |
|
|
|
for (int i = 0; i < assets.Length; i++) |
|
|
|
{ |
|
|
|
allInstances.Add(new Instance(assets[i])); |
|
|
|
} |
|
|
|
allInstances.AddRange(Inspect<T>(b)); |
|
|
|
} |
|
|
|
return allInstances.ToArray(); |
|
|
|
} |
|
|
|
|
|
|
|
public static string[] InspectNames<T>() where T : UnityEngine.Object |
|
|
|
public static Instance[] Inspect<T>(AssetBundle assetBundle) where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
List<Instance> allInstances = new List<Instance>(); |
|
|
|
UnityEngine.Object[] assets = assetBundle.LoadAllAssets<T>(); |
|
|
|
for (int i = 0; i < assets.Length; i++) |
|
|
|
{ |
|
|
|
allInstances.Add(new Instance(assets[i])); |
|
|
|
} |
|
|
|
return allInstances.ToArray(); |
|
|
|
} |
|
|
|
|
|
|
|
public static string[] InspectNames<T>() where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
if (allBundles == null) Init(); |
|
|
|
List<string> allNames = new List<string>(); |
|
|
|
foreach (var b in allBundles) |
|
|
|
{ |
|
|
|
UnityEngine.Object[] assets = b.LoadAllAssets<T>(); |
|
|
|
for (int i = 0; i < assets.Length; i++) |
|
|
|
{ |
|
|
|
allNames.Add(assets[i].name); |
|
|
|
} |
|
|
|
allNames.AddRange(InspectNames<T>(b)); |
|
|
|
} |
|
|
|
return allNames.ToArray(); |
|
|
|
} |
|
|
|
|
|
|
|
public static string[] InspectNames<T>(AssetBundle assetBundle) where T : UnityEngine.Object |
|
|
|
{ |
|
|
|
List<string> allNames = new List<string>(); |
|
|
|
UnityEngine.Object[] assets = assetBundle.LoadAllAssets<T>(); |
|
|
|
for (int i = 0; i < assets.Length; i++) |
|
|
|
{ |
|
|
|
allNames.Add(assets[i].name); |
|
|
|
} |
|
|
|
return allNames.ToArray(); |
|
|
|
} |
|
|
|