Dojo
Loading...
Searching...
No Matches
Dojo.Netcode.DojoNetcodeObjectPool Class Reference

Netcode object pool implementation for Dojo. More...

Inheritance diagram for Dojo.Netcode.DojoNetcodeObjectPool:

Public Member Functions

void Start ()
 Unity Start method.
 
void OnValidate ()
 Unity OnValidate method.
 
GameObject GetPrefabAt (int idx)
 Get prefab game object by idx\n Prefab must be registered in pool.
 
NetworkObject GetNetworkObject (GameObject prefab)
 Get an instance of the given prefab from pool with default pose.
The prefab must be registered in pool.
 
NetworkObject GetNetworkObject (GameObject prefab, Vector3 position, Quaternion rotation)
 Get an instance of the given prefab from pool with given pose.
The prefab must be registered in pool.
 
void ReturnNetworkObject (NetworkObject networkObject, GameObject prefab)
 Return an object to the pool and reset it.
 
void AddPrefab (GameObject prefab, int prewarmCount=0)
 Register a prefab game object to pool.
 

Detailed Description

Netcode object pool implementation for Dojo.

See also
Reference

Member Function Documentation

◆ AddPrefab()

void Dojo.Netcode.DojoNetcodeObjectPool.AddPrefab ( GameObject  prefab,
int  prewarmCount = 0 
)
inline

Register a prefab game object to pool.

Parameters
prefabprefab game object
prewarmCountnumber of pre-instantiated objects

◆ GetNetworkObject() [1/2]

NetworkObject Dojo.Netcode.DojoNetcodeObjectPool.GetNetworkObject ( GameObject  prefab)
inline

Get an instance of the given prefab from pool with default pose.
The prefab must be registered in pool.

Parameters
prefabprefab game object
Returns
instantiated NetworkObject from prefab

◆ GetNetworkObject() [2/2]

NetworkObject Dojo.Netcode.DojoNetcodeObjectPool.GetNetworkObject ( GameObject  prefab,
Vector3  position,
Quaternion  rotation 
)
inline

Get an instance of the given prefab from pool with given pose.
The prefab must be registered in pool.

Parameters
prefabprefab game object
positiontarget position
rotationtarget rotation
Returns
instantiated NetworkObject from prefab with target pose

◆ GetPrefabAt()

GameObject Dojo.Netcode.DojoNetcodeObjectPool.GetPrefabAt ( int  idx)
inline

Get prefab game object by idx\n Prefab must be registered in pool.

Parameters
idxindex
Returns
prefab game object

◆ ReturnNetworkObject()

void Dojo.Netcode.DojoNetcodeObjectPool.ReturnNetworkObject ( NetworkObject  networkObject,
GameObject  prefab 
)
inline

Return an object to the pool and reset it.

Parameters
networkObjectobject to return
prefabcorresponding prefab game object

The documentation for this class was generated from the following file: