ドキュメント

Unity Engine

Unity Engine

Load()

Loads the object synchronously. Blocks until loading is complete.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.Loading
  • Assembly: UnityEngine.ContentLoadModule
public T Load()

Returns

Type

Description

TThe loaded object, or
null
if loading failed.

Remarks

Load does not throw when the asset cannot be returned. Instead it returns
null
, logs an error, and sets Loadable<T>.Status to LoadableStatus.Failed. This happens when the asset is not present in any registered content directory, when it has already been released, or when the loaded object cannot be cast to
T
because the Loadable<T>.LoadableObjectId points at an object of an incompatible type.