class ServerAuthoritativeSpawnerBase (Niantic.ARDK.Networking.ARSim.Spawning.ServerAuthoritativeSpawnerBase)¶
Overview¶
Abstract base for a server authoritative spawner. Contains base implementation for maintaining and verifying spawning objects, despawning objects, and updating the positions of spawned objects. More…
class ServerAuthoritativeSpawnerBase: Niantic.ARDK.Networking.ARSim.Spawning.IServerAuthoritativeSpawner { public: // structs struct ServerDespawnParams; struct ServerSpawnParams; struct UpdatePositionParams; // events event DidSpawnObject(); event WillDespawnObject(); // methods virtual abstract void Dispose() = 0; void LoadPrefabManifest(IAddressablePrefabManifest manifest); void SetGameObjectInstantiator(IGameObjectInstantiator instantiator); void Spawn(ServerSpawnParams spawnParams); };
Inherited Members¶
public: // events event DidSpawnObject(); event WillDespawnObject(); // methods void LoadPrefabManifest(IAddressablePrefabManifest manifest); void SetGameObjectInstantiator(IGameObjectInstantiator instantiator); void Spawn(ServerAuthoritativeSpawnerBase.ServerSpawnParams spawnParams);
Detailed Documentation¶
Abstract base for a server authoritative spawner. Contains base implementation for maintaining and verifying spawning objects, despawning objects, and updating the positions of spawned objects.
Methods¶
void SetGameObjectInstantiator(IGameObjectInstantiator instantiator)
Set the instantiator that the spawner will use to create gameobjects. Different IGameObjectInstantiators can be implemented to use custom spawning behaviour, such as dependency injection or object pooling.
Note
If no instantiator is provided by the first spawn call, a UnityGameObjectInstantiator will be used.
void Spawn(ServerSpawnParams spawnParams)
Spawn an object with the specified parameters
Note
This is public for catch-up spawning. Will be made internal after spawning is guaranteed.
Parameters:
spawnParams |
Details of the object to spawn |