docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetAssetPreview

    GetAssetPreview(Object, Action<Texture>)

    Tries to get an AssetPreview for an asset.

    Declaration
    public static IEnumerator GetAssetPreview(Object asset, Action<Texture> callback)
    Parameters
    Type Name Description
    Object asset

    The asset for which to get a preview.

    Action<Texture> callback

    Called with the preview texture as an argument, when it becomes available.

    Returns
    Type Description
    IEnumerator

    An enumerator used to tick the coroutine.

    Remarks

    If a preview is not immediately available, this function waits until IsLoadingAssetPreview(int) changes to false. If the preview has still not loaded, the function uses GetMiniThumbnail instead.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)