RefreshAsset()
Re-resolves the asset and pushes the result to subscribers.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
public void RefreshAsset()
Remarks
Loads the asset again and invokes LocalizedAsset<TObject>.AssetChanged with the new value. Does nothing when no handler is subscribed. It runs automatically when the reference changes or the selected locale changes, so call it manually only when an external input requires a reload.
Force a reload of the localized asset.
Examples
using Unity.Localization;namespace Unity.Localization.Samples{ public class LocalizedAssetRefreshExample { public void Refresh() { var localizedTexture = new LocalizedTexture(); localizedTexture.SetReference("My Assets", "ICON"); localizedTexture.RefreshAsset(); } }}