Version: 2022.3
LanguageEnglish
  • C#

ContentFile.UnloadAsync

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Unity.Loading.ContentFileUnloadHandle UnloadAsync();

Returns

ContentFileUnloadHandle A handle that can be used to track the status of the unload operation.

Description

Begin an asynchronous unload of the ContentFile.

If you call this while a load is in progress, it will attempt to cancel the loading process.

This must be called in order to release resources, even when the ContentFile load operation was not successful.

An exception will be thrown if this ContentFile is being used as a dependency by another ContentFile. In this case, the other file must be unloaded first.