4.Scripting
Whenever using the API, ensure you add using sc.splines.spawner.runtime; to include the namespace.
The Spline Spawner
component and class exposes a few events, designed to facilitate custom functionality. For instance, you may want to execute certain scripts whenever objects are respawned.
Changing splines
Use the SplineSpawner.SetSplineContainer()
function. This ensures that the cached spline data is rebuilt based on the new container. You may call Respawn()
after wards.
Events
onPreRespawn(SplineSpawner instance, int splineIndex)
Triggers when respawning is about to start
onPostRespawn(SplineSpawner instance, int splineIndex)
Triggers after all the respawning operations have completed
onAfterDistribution(NativeList<SpawnPoint> spawnPoints)
Triggers after the spawn point distribution has taken place.
onAfterModifiers(NativeList<SpawnPoint> spawnPoints)
Triggers after modifiers have processed the spawn points, but before the objects are actually spawned.