Class LocalizedAsset<TObject> | Localization | 0.9.0-preview
docs.unity3d.com
    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 © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023