Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ISynchronousAssetEntry

An optional capability for an asset entry that can resolve its asset immediately, without an asynchronous load.
Read time 1 minuteLast updated 7 days ago

Definition

  • Type: Interface
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
public interface ISynchronousAssetEntry

Remarks

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<TObject> 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<TObject>
The built-in asset entries implement this, so a localized asset backed by them resolves synchronously.

Examples

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(); } }}

Methods

Method

Description

TryLoadAssetTries to resolve the entry's asset without loading asynchronously.