Class LocalizedAsset<TObject> | Localization | 0.8.1-preview
docs.unity.cn
    Show / Hide Table of Contents

    Class LocalizedAsset<TObject>

    Used to reference a localized asset and provide an interface to loading and registering to changes. LocalizedReference

    Inheritance
    Object
    LocalizedReference
    LocalizedAsset<TObject>
    LocalizedAudioClip
    LocalizedGameObject
    LocalizedSprite
    LocalizedTexture
    Inherited Members
    LocalizedReference.TableReference
    LocalizedReference.TableEntryReference
    LocalizedReference.IsEmpty
    LocalizedReference.SetReference(TableReference, TableEntryReference)
    LocalizedReference.ToString()
    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>

    Methods

    ForceUpdate()

    Declaration
    protected override void ForceUpdate()
    Overrides
    LocalizedReference.ForceUpdate()

    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<>
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Wednesday, August 19, 2020