Update: 1.1.0 - Advanced Controls (Keyboard and GamePad)
- It’s now possible to have Keyboard and GamePad input at the same time.
- It’s now possible to add multiple keys or buttons to the SplineWalker; just one of those buttons can be pressed at the same time.
- Renamed AlreadyTriggered to CanTrigger in the SplineWalker class.
- Made sure that we have the _currentTriggerIndex value higher than -1 to avoid out of range bugs.
- Fixed a bug where the current trigger index went wrong when quickly changed the walking direction.
- Added Tank class (SplineWalker) and TankTrack BezierSpline to show the new input features.
- It’s now possible to control a SplineWalker with a Keyboard and a GamePad.
- Renamed Mode to WalkerMode in the SplineWalker class.
- A SplineWalker can now trigger events in different directions. For example only when he travels forward, backward or forward and backward.
- A SplineWalker can now perform a turn (rotating 180 degrees) when walking in the opposite direction (PingPong WalkingMode).
- Added new sample project AdvancedControls.cs
This update was actually way more difficult to make than I originally thought. Reason for this is the current trigger index, which can be dynamic now, because the new input capabilities allowing to walk dynamically on the spline.
See for yourself:
You have also multiple trigger mode options now. You can for example allow that the trigger on a spline only triggering, when a SplineWalker walks in the forward-, backward- or both directions.
You can also allow spline revolutions (SplineWalker walks from the last to the first trigger on the spline), when the WalkerMode is not “Once”. In the opposite it’s possible to disallow spline revolutions, when a SplineWalker’s mode is set to “Once” but not to “Loop” or “PingPong”.
Oh, and by the way: You can also rotate the turret of the tank you saw in the video with the right thumbstick, but… shhhhhhhhht: we don’t want that something bad will happen!!
Have a nice day!