docs.unity3d.com
    目次を表示する/隠す

    Method ProvideResources

    ProvideResources<TObject>(IList<IResourceLocation>, Action<TObject>)

    Asynchronously load all objects in the given collection of locations. If any matching location fails, all loads and dependencies will be released. The returned .Result will be null, and .Status will be Failed.

    Declaration
    public AsyncOperationHandle<IList<TObject>> ProvideResources<TObject>(IList<IResourceLocation> locations, Action<TObject> callback = null)
    Parameters
    Type Name Description
    IList<IResourceLocation> locations

    locations to load.

    Action<TObject> callback

    This callback will be invoked once for each object that is loaded.

    Returns
    Type Description
    AsyncOperationHandle<IList<TObject>>

    An async operation that will complete when all individual async load operations are complete.

    Type Parameters
    Name Description
    TObject

    Object type to load.

    ProvideResources<TObject>(IList<IResourceLocation>, Boolean, Action<TObject>)

    Asynchronously load all objects in the given collection of locations.

    Declaration
    public AsyncOperationHandle<IList<TObject>> ProvideResources<TObject>(IList<IResourceLocation> locations, bool releaseDependenciesOnFailure, Action<TObject> callback = null)
    Parameters
    Type Name Description
    IList<IResourceLocation> locations

    locations to load.

    Boolean releaseDependenciesOnFailure

    If all matching locations succeed, this parameter is ignored. When true, if any matching location fails, all loads and dependencies will be released. The returned .Result will be null, and .Status will be Failed. When false, if any matching location fails, the returned .Result will be an IList of size equal to the number of locations attempted. Any failed location will correlate to a null in the IList, while successful loads will correlate to a TObject in the list. The .Status will still be Failed. When true, op does not need to be released if anything fails, when false, it must always be released.

    Action<TObject> callback

    This callback will be invoked once for each object that is loaded.

    Returns
    Type Description
    AsyncOperationHandle<IList<TObject>>

    An async operation that will complete when all individual async load operations are complete.

    Type Parameters
    Name Description
    TObject

    Object type to load.

    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)