Dreamteck / splines

The official Dreamteck Splines for Unity repository
Apache License 2.0
22 stars 2 forks source link

Object Controller feature: spawn method #3

Closed Kronoxis closed 1 year ago

Kronoxis commented 1 year ago

As requested on Discord, adds a feature to the Object Controller component that allows the controller to automatically set the spawn count equal to number of spline points. This is useful for spawning objects on only spline points, which for example can be used to build corner pieces on linear splines.

SpawnMethod Options

Count

Preserves the original behaviour, which uses spawnCount to control the number of objects.

Points

Synchronizes the number of objects with number of points on the spline.

Notes

Tests

Checkout the test branch for a test scene. There are a few scripts to modify the spline and object controller at runtime which can be played around with. Simply enable a script to run the test.

This PR should not introduce any breaking changes, as the default behaviour of the ObjectController remains unchanged. It simply exposes an optional setting for convenience.