UNetPoolingSpawnHandler Method |
[This is preliminary documentation and is subject to change.]
Namespace: Umbrace.Unity.PurePool.UNet
public GameObject SpawnHandler( Vector3 position, NetworkHash128 assetId )
Exception | Condition |
---|---|
ArgumentException | When assetId has not been registered with ClientScene. |
This method should be passed to the RegisterPrefab(GameObject, SpawnDelegate, UnSpawnDelegate) or RegisterSpawnHandler(NetworkHash128, SpawnDelegate, UnSpawnDelegate) methods.
Objects spawned using SpawnHandler(Vector3, NetworkHash128) should not be destroyed manually, but instead should be passed to UnspawnHandler(GameObject), to allow pooling to work. When using UNet, this means you should call UnSpawn(GameObject) instead of Destroy(GameObject).