ReleaseAsset(Object)
Releases an asset previously returned by a load.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
void ReleaseAsset(Object asset)
Parameters
The asset to release.
Remarks
Hand every loaded asset back to the same entry so the owning kind can free it. AssetEntry holds a direct reference and does nothing, while ResourceAssetEntry unloads through Resources.
Additional Resources: IAssetEntry.HasAsset()
Release an asset once you are finished with it.
Examples
using Unity.Localization;namespace Unity.Localization.Samples{ public class IAssetEntryReleaseAssetExample { public void Run() { var entry = new ResourceAssetEntry { Default = "UI/banner" }; if (entry.TryLoadAsset(out var asset)) entry.ReleaseAsset(asset); // unload once you are finished with it } }}