|
Runtime Spawner 1.5.1
Generic Runtime spawn and instance pooling system for spawning random AI agents around a map. Works with ANY AI system easily.
|
MonoBehaviour-based Fusion object provider that provisions instances from the project pool via PoolAdapter. More...
Public Member Functions | |
| override NetworkObjectAcquireResult | AcquirePrefabInstance (NetworkRunner runner, in NetworkPrefabAcquireContext context, out NetworkObject instance) |
| override void | ReleaseInstance (NetworkRunner runner, in NetworkObjectReleaseContext context) |
| void | Prewarm (GameObject prefab, int count) |
| Prewarms the underlying pool with instances of prefab . | |
Private Member Functions | |
| void | Awake () |
Private Attributes | |
| IPoolAdapter | _pool |
| readonly Dictionary< NetworkPrefabId, GameObject > | _prefabMap = new() |
MonoBehaviour-based Fusion object provider that provisions instances from the project pool via PoolAdapter.
Attach this component to the same GameObject as your NetworkRunner. When the runner is started with this component set as StartGameArgs.ObjectProvider, Fusion will call AcquirePrefabInstance and ReleaseInstance for prefab-backed NetworkObjects.
This is the behaviour-based counterpart to FusionPoolProvider. Both providers are recognized by FusionObjectFactory.Prewarm(SpawnEntry,int) for prewarming pools.
| override NetworkObjectAcquireResult MegaCrush.Spawner.FusionAdapter.FusionPoolObjectProviderBehaviour.AcquirePrefabInstance | ( | NetworkRunner | runner, |
| in NetworkPrefabAcquireContext | context, | ||
| out NetworkObject | instance ) |
|
private |
| void MegaCrush.Spawner.FusionAdapter.FusionPoolObjectProviderBehaviour.Prewarm | ( | GameObject | prefab, |
| int | count ) |
Prewarms the underlying pool with instances of prefab .
| prefab | Prefab to prime in the pool. |
| count | Number of instances to precreate (ignored if <= 0). |
| override void MegaCrush.Spawner.FusionAdapter.FusionPoolObjectProviderBehaviour.ReleaseInstance | ( | NetworkRunner | runner, |
| in NetworkObjectReleaseContext | context ) |
|
private |
|
private |