Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

ReferencedAssetProvider.Release

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 void Release(Object asset);

Parameters

Parameter Description
asset The asset to release. Ignored.

Description

Does nothing, because this provider does not own the assets it returns.

The references are owned by whatever holds this provider, so there is nothing to unload. This method exists to satisfy IAssetProvider.

<para>Call release on a referenced asset. Nothing is unloaded.</para>

using Unity.Localization.Providers;
using UnityEngine;

namespace Unity.Localization.Samples { public class ReferencedAssetProviderReleaseExample { public void Run() { var provider = new ReferencedAssetProvider(); var texture = new Texture2D(2, 2); provider.Add("UI/Logo", texture);

provider.Release(texture); // no-op: the reference is owned elsewhere } } }