docs.unity.cn
    Show / Hide Table of Contents

    Class LocalizedAssetBase

    Base class for all localized assets.

    Inheritance
    Object
    LocalizedReference
    LocalizedAssetBase
    LocalizedAsset<TObject>
    Inherited Members
    LocalizedReference.TableReference
    LocalizedReference.TableEntryReference
    LocalizedReference.FallbackState
    LocalizedReference.LocaleOverride
    LocalizedReference.WaitForCompletion
    LocalizedReference.IsEmpty
    LocalizedReference.SetReference(TableReference, TableEntryReference)
    LocalizedReference.ForceUpdate()
    LocalizedReference.Reset()
    Namespace: UnityEngine.Localization
    Syntax
    public abstract class LocalizedAssetBase : LocalizedReference, ISerializationCallbackReceiver

    Methods

    LoadAssetAsObjectAsync()

    Returns the localized asset as a UnityEngine.Object.

    Declaration
    public abstract AsyncOperationHandle<Object> LoadAssetAsObjectAsync()
    Returns
    Type Description
    AsyncOperationHandle<Object>

    LoadAssetAsync<TObject>()

    Overrides the asset's default type. This loads a type from AssetTable with the TableReference and the the asset that matchesTableEntryReference. This helps to filter sub-assets when trying to load them and they share a common type among other sub-assets with the same name.
    For example, an asset could have the following structure:
    Main Asset [GameObject]
    - Sub Asset[GameObject]
    - Sub Asset[Mesh] If you were using a LocalizedObject, calling orLoadAssetAsObjectAsync() to load "Main Asset/Sub Asset" would return the first matching asset. In this case, this would be the GameObject version. With this method, you could provide the type Mesh to filter out the GameObject version and return the Mesh.

    Declaration
    public abstract AsyncOperationHandle<TObject> LoadAssetAsync<TObject>()
        where TObject : Object
    Returns
    Type Description
    AsyncOperationHandle<TObject>

    Returns the loading operation for the request.

    Type Parameters
    Name Description
    TObject

    The type to use instead of the default.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023