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.
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.
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
RebuildImmediate
calls have been added. Read comments for explanation. Specifically, https://github.com/Kronoxis/splines/blob/467ca7419b4b5c5c2c01bd4da77e30a6e2d70a2e/Assets/Dreamteck/Splines/Components/ObjectController.cs#L594-L596 https://github.com/Kronoxis/splines/blob/467ca7419b4b5c5c2c01bd4da77e30a6e2d70a2e/Assets/Dreamteck/Splines/Components/ObjectController.cs#L666-L672 https://github.com/Kronoxis/splines/blob/467ca7419b4b5c5c2c01bd4da77e30a6e2d70a2e/Assets/Dreamteck/Splines/Components/ObjectController.cs#L684-L686 If this does not match the performance guidelines of the package, let me know.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.