An optional capability for an asset entry that can resolve its asset immediately, without an asynchronous load.
Implement this alongside IAssetEntry when the entry already has its asset in hand, such as a direct
object reference or a synchronous Resources load, so LocalizedAsset<T0> can resolve it
on the synchronous path (the GetLocalizedAsset accessor, or under the LoadingPreference.Synchronous
loading preference). An entry kind that can only load asynchronously (for example an Addressables-backed kind provided by a
package) does not implement this interface, and the synchronous path falls back to whatever is already cached.
Additional resources: IAssetEntry, LocalizedAsset<T0>
<para>The built-in asset entries implement this, so a localized asset backed by them resolves synchronously.</para>
using Unity.Localization; using UnityEngine;
namespace Unity.Localization.Samples { public class SynchronousAssetEntryExample { public Texture Load() { var localizedTexture = new LocalizedTexture(); localizedTexture.SetReference("My Assets", "ICON"); return localizedTexture.GetLocalizedAsset(); } } }
| Method | Description |
|---|---|
| TryLoadAsset | Tries to resolve the entry's asset without loading asynchronously. |