Skip to main content

Interface IGearChangeable

Abstracts the Drive/Reverse gear state so that both PlayerCarDriver and the AI path-follow system can flip gears through the same call without knowing the concrete controller implementation.

public interface IGearChangeable

Remarks​

The input threshold convention (≥ 1f → Drive, ≤ −1f → Reverse) lets the caller pass raw signed throttle without a separate gear-select step, matching how both the player and the AI naturally produce signed speed signals.

Properties​

Gear​

Gets the current gear type of the component.

GearType Gear { get; }

Property Value​

GearType

Methods​

ChangeGear(float)​

Changes the gear based on the input value.

  • Input >= 1f: Changes to Drive gear
  • Input <= -1f: Changes to Reverse gear
void ChangeGear(float input)

Parameters​

NameTypeDescription
inputfloatThe directional input to determine the target gear.