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 where TObject : Object
Type Parameters
Name | Description |
---|---|
TObject |
Properties
CurrentLoadingOperation
The current loading operation for the Asset when using a AssetChanged.
Declaration
public AsyncOperationHandle<TObject> CurrentLoadingOperation { get; }
Property Value
Type | Description |
---|---|
AsyncOperationHandle<TObject> |
HasChangeHandler
True if AssetChanged has any subscribers.
Declaration
public bool HasChangeHandler { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
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. |
Events
AssetChanged
Called whenever a localized asset is available. When the first LocalizedAsset<TObject>.ChangeHandler is added, a loading operation will automatically start and the localized asset will be sent to the event when completed. Any adding additional subscribers added after loading has completed will also be sent the latest localized asset when they are added. This ensures that a subscriber will always have the correct localized asset regardless of when it was added. The asset will be refreshed whenever SelectedLocaleChanged is changed. LoadAssetAsync() when not using the event.
Declaration
public event LocalizedAsset<TObject>.ChangeHandler AssetChanged
Event Type
Type | Description |
---|---|
LocalizedAsset.ChangeHandler<> |