Method GetOrInstantiate
GetOrInstantiate(GameObject)
Retrieves an existing instance of the given prefab from the cache if available. Otherwise, instantiate a new instance of the given prefab.
Declaration
public GameObject GetOrInstantiate(GameObject prefab)
Parameters
Type | Name | Description |
---|---|---|
GameObject | prefab |
Returns
Type | Description |
---|---|
GameObject |
Exceptions
Type | Condition |
---|---|
ArgumentException |