Resources.UnloadUnusedAssets Manual     Reference     Scripting  
Scripting > Runtime Classes > Resources
Resources.UnloadUnusedAssets

static function UnloadUnusedAssets () : AsyncOperation

Returns

AsyncOperation - object on which you can yield to wait until the operation completes.

Description

Unloads assets that are not used.

An asset is deemed to be unused if it isn't reached after walking the whole game object hierarchy, including script components. Static variables are also examined.