Class DebugTools
- Namespace
- Silksong.AssetHelper.Dev
- Assembly
- AssetHelper.dll
Class providing tools to help find information about the asset database.
The methods on this class should not be used in production code, and may be changed at any time.
The separate AssetHelperMenu plugin provides an interface to some of the methods on this class through the ModMenu.
public static class DebugTools
- Inheritance
-
DebugTools
- Inherited Members
Properties
DebugDataDir
The directory where functions in DebugTools write their output.
This is a subfolder of this plugin's assembly.
public static string DebugDataDir { get; }
Property Value
Methods
DumpAddressablesKeys()
Dump all addressable keys to the bundle_keys.json file in the debug data dir.
public static void DumpAddressablesKeys()
DumpAllAddressableAssets()
Write a list of all Addressable assets loadable using LoadAssetAsync<TObject>(object) directly.
This only includes base game addressable assets; assets from catalogs added by AssetHelper are not included.
The list includes the most important information about each asset.
public static void DumpAllAddressableAssets()
DumpAllAddressableAssets(IResourceLocator, string, bool)
Write a list of all Addressable assets in the catalog given by the provided locator.
The output includes a json dictionary of type {primary key -> list of location infos}.
public static void DumpAllAddressableAssets(IResourceLocator locator, string fileName, bool includeDependencyNames = false)
Parameters
locatorIResourceLocatorfileNamestringThe name of the file within the debug data dir.
includeDependencyNamesboolWhether to include the names of dependencies. The dependency names will be in the form
[primaryKey | internalId]. This will significantly increase the size of the outputted file.
DumpAllAssetNames()
Dump all asset names to the asset_names.json file in the debug data dir.
This function loads all asset bundles, so is quite slow.
public static void DumpAllAssetNames()
DumpGameObjectPaths(string, bool)
Dump all game object paths to paths_{sceneName}.json in the debug data dir.
If compressed is true, the output file will be paths_{sceneName}_compressed.json.
public static void DumpGameObjectPaths(string sceneName, bool compressed)
Parameters
sceneNamestringThe name of the scene.
compressedboolIf true, dump as entries "objPath [goPathId, transformPathId]". If false, dump as full json.
DumpLoadedBundleNames()
Call GetLoadedBundleNames(), and dump the result to a file in the debug data folder.
public static void DumpLoadedBundleNames()
GetLoadedBundleNames()
Get a readable list of loaded bundle names (paths relative to the bundle base dir).
The first time this is used in each Silksong version, it will generate a lookup of bundle name -> readable name, which can be quite slow.
public static DebugTools.LoadedBundleNames GetLoadedBundleNames()
Returns
Exceptions
- InvalidOperationException
Raised if this is called before Addressables is ready.
SerializeAssetRequest(string)
Dump the overall asset request to the debug data dir.
public static void SerializeAssetRequest(string filename = "asset_request.json")
Parameters
filenamestring