Method ShiftDown
ShiftDown()
Shifts the gear box down. Note that this will not shift into reverse from neutral gear.
ShiftDown()
will take care about the appropriate checks for you and won't shift your gear down if you are already
in the lowest gear.
Declaration
public IEnumerator ShiftDown()
Returns
Type | Description |
---|---|
IEnumerator | Returns an IEnumerator instance, to be used in conjunction with StartCoroutine from a MonoBehaviour script. |
Examples
You can shift the gear box up like this:
using YACC;
public class MyCarEngineController : MonoBehaviour {
private GearBox gearBox = new(
new float[] { 2.66f, 1.78f, 1.30f, 1.00f, 0.74f }, // Gear Ratios
4.10f, // Final drive ratio
3.23f, // Reverse ratio
0.5f // Shift time
);
void Update() {
if (Input.GetKeyDown(KeyCode.DownArrow)) {
StartCoroutine(gearBox.ShiftUp());
}
}
}