Netcode object pool implementation for Dojo.
More...
|
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.
|
|
Netcode object pool implementation for Dojo.
- See also
- Reference
◆ AddPrefab()
void Dojo.Netcode.DojoNetcodeObjectPool.AddPrefab |
( |
GameObject |
prefab, |
|
|
int |
prewarmCount = 0 |
|
) |
| |
|
inline |
Register a prefab game object to pool.
- Parameters
-
prefab | prefab game object |
prewarmCount | number 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
-
- 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
-
prefab | prefab game object |
position | target position |
rotation | target 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
-
- 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
-
networkObject | object to return |
prefab | corresponding prefab game object |
The documentation for this class was generated from the following file:
- Unity/Assets/Dojo/Netcode/DojoNetcodeObjectPool.cs