Class LocalizedAsset<TObject>
Used to reference a localized asset and provide an interface to loading and registering to changes. LocalizedReference
Inherited Members
Namespace: UnityEngine.Localization
Syntax
[Serializable]
public class LocalizedAsset<TObject> : LocalizedReference
Type Parameters
Name | Description |
---|---|
TObject |
Properties
CurrentLoadingOperation
The current loading operation for the Asset when using a LocalizedAsset<TObject>.ChangeHandler.
Declaration
public AsyncOperationHandle<TObject>? CurrentLoadingOperation { get; }
Property Value
Type | Description |
---|---|
Nullable<AsyncOperationHandle<TObject>> |
Methods
ClearChangeHandler()
Removes the handler and stops listening to changes to SelectedLocaleChanged.
Declaration
public void ClearChangeHandler()
ForceUpdate()
Declaration
protected override void ForceUpdate()
Overrides
LoadAssetAsync()
Load the referenced asset as type TObject.
Declaration
public AsyncOperationHandle<TObject> LoadAssetAsync()
Returns
Type | Description |
---|---|
AsyncOperationHandle<TObject> | The load operation. |
RegisterChangeHandler(LocalizedAsset<TObject>.ChangeHandler)
Register a handler that will be called whenever the LocalizedAsset has finished loading. When a handler is registered, the asset will then be automatically loaded whenever the SelectedLocaleChanged is changed. LoadAssetAsync() when not using a change handler.
Declaration
public void RegisterChangeHandler(LocalizedAsset<TObject>.ChangeHandler handler)
Parameters
Type | Name | Description |
---|---|---|
LocalizedAsset.ChangeHandler<> | handler | A handler that will be called when the LocalizedAsset is ready for use. |