Created
February 3, 2014 21:19
-
-
Save wmiller/8792631 to your computer and use it in GitHub Desktop.
XML Database ValidateAssetBundleAssetsInternal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ValidateAssetBundleAssetsInternal() | |
{ | |
// Get all asset infos from the database and iterate over them | |
AssetInfo[] assetInfos = Database.Instance.GetEntries<AssetInfo>(); | |
foreach (AssetInfo assetInfo in assetInfos) | |
{ | |
// Load the object referenced by the asset info. Warn if the | |
// object fails to load | |
Object asset = Resources.LoadAssetAtPath<Object>(assetInfo.Path); | |
if (!asset) | |
{ | |
Debug.LogWarning("Invalid Asset: " + assetInfo.Path + " in AssetInfo: " + assetInfo.DatabaseID.ToString()); | |
} | |
} | |
// Clean up | |
Resources.UnloadUnusedAssets(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment