Method InstantiateAsync
InstantiateAsync(IResourceLocation, Transform, Boolean, Boolean)
Instantiate a single object.
Declaration
public static AsyncOperationHandle<GameObject> InstantiateAsync(IResourceLocation location, Transform parent = null, bool instantiateInWorldSpace = false, bool trackHandle = true)
Parameters
Type | Name | Description |
---|---|---|
IResourceLocation | location | The location of the Object to instantiate. |
Transform | parent | Parent transform for instantiated object. |
Boolean | instantiateInWorldSpace | Option to retain world space when instantiated with a parent. |
Boolean | trackHandle | If true, Addressables will track this request to allow it to be released via the result object. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<GameObject> | The operation handle for the request. |
Remarks
Note that the dependency loading is done asynchronously, but generally the actual instantiate is synchronous.
See Instantiating objects from Addressables documentation for more details.
InstantiateAsync(IResourceLocation, Vector3, Quaternion, Transform, Boolean)
Instantiate a single object.
Declaration
public static AsyncOperationHandle<GameObject> InstantiateAsync(IResourceLocation location, Vector3 position, Quaternion rotation, Transform parent = null, bool trackHandle = true)
Parameters
Type | Name | Description |
---|---|---|
IResourceLocation | location | The location of the Object to instantiate. |
Vector3 | position | The position of the instantiated object. |
Quaternion | rotation | The rotation of the instantiated object. |
Transform | parent | Parent transform for instantiated object. |
Boolean | trackHandle | If true, Addressables will track this request to allow it to be released via the result object. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<GameObject> | The operation handle for the request. |
Remarks
Note that the dependency loading is done asynchronously, but generally the actual instantiate is synchronous.
See Instantiating objects from Addressables documentation for more details.
InstantiateAsync(Object, Transform, Boolean, Boolean)
Instantiate a single object.
Declaration
public static AsyncOperationHandle<GameObject> InstantiateAsync(object key, Transform parent = null, bool instantiateInWorldSpace = false, bool trackHandle = true)
Parameters
Type | Name | Description |
---|---|---|
Object | key | The key of the location of the Object to instantiate. |
Transform | parent | Parent transform for instantiated object. |
Boolean | instantiateInWorldSpace | Option to retain world space when instantiated with a parent. |
Boolean | trackHandle | If true, Addressables will track this request to allow it to be released via the result object. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<GameObject> | The operation handle for the request. |
Remarks
Note that the dependency loading is done asynchronously, but generally the actual instantiate is synchronous.
See Instantiating objects from Addressables documentation for more details.
InstantiateAsync(Object, Vector3, Quaternion, Transform, Boolean)
Instantiate a single object.
Declaration
public static AsyncOperationHandle<GameObject> InstantiateAsync(object key, Vector3 position, Quaternion rotation, Transform parent = null, bool trackHandle = true)
Parameters
Type | Name | Description |
---|---|---|
Object | key | The key of the location of the Object to instantiate. |
Vector3 | position | The position of the instantiated object. |
Quaternion | rotation | The rotation of the instantiated object. |
Transform | parent | Parent transform for instantiated object. |
Boolean | trackHandle | If true, Addressables will track this request to allow it to be released via the result object. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<GameObject> | The operation handle for the request. |
Remarks
Note that the dependency loading is done asynchronously, but generally the actual instantiate is synchronous.
See Instantiating objects from Addressables documentation for more details.
InstantiateAsync(Object, InstantiationParameters, Boolean)
Instantiate a single object.
Declaration
public static AsyncOperationHandle<GameObject> InstantiateAsync(object key, InstantiationParameters instantiateParameters, bool trackHandle = true)
Parameters
Type | Name | Description |
---|---|---|
Object | key | The key of the location of the Object to instantiate. |
InstantiationParameters | instantiateParameters | Parameters for instantiation. |
Boolean | trackHandle | If true, Addressables will track this request to allow it to be released via the result object. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<GameObject> | The operation handle for the request. |
Remarks
Note that the dependency loading is done asynchronously, but generally the actual instantiate is synchronous.
See Instantiating objects from Addressables documentation for more details.
InstantiateAsync(IResourceLocation, InstantiationParameters, Boolean)
Instantiate a single object.
Declaration
public static AsyncOperationHandle<GameObject> InstantiateAsync(IResourceLocation location, InstantiationParameters instantiateParameters, bool trackHandle = true)
Parameters
Type | Name | Description |
---|---|---|
IResourceLocation | location | The location of the Object to instantiate. |
InstantiationParameters | instantiateParameters | Parameters for instantiation. |
Boolean | trackHandle | If true, Addressables will track this request to allow it to be released via the result object. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<GameObject> | The operation handle for the request. |
Remarks
Note that the dependency loading is done asynchronously, but generally the actual instantiate is synchronous.
See Instantiating objects from Addressables documentation for more details.