C# Class CarController, racing_game

Inheritance: MonoBehaviour
显示文件 Open project: Rarau/racing_game Class Usage Examples

Public Properties

Property Type Description
brakePos float
brakingPower float
cDrag float
cRoll float
carMass float
centerOfMass Transform
currentGear int
currentSpeed float
differentialRatio float
driftAssist float
engineTorque float
gearRatio float
gearsRatio float[]
handBrake bool
maxGears int
maxSpeed float
maxTorque float
maximumSpeed int
peakTorque float
playerNumber int
rpm float
rpmMax float
rpmMin float
steeringAngle float
steeringSensitityCurve AnimationCurve
steeringSensitivity float
throttlePos float
torqueRPMCurve AnimationCurve[]
virtualRPM float
wheels WheelController[]

Public Methods

Method Description
FixedUpdate ( ) : void
GearsShift ( ) : void

Shifts gear up or down according to speed.

IsFlying ( ) : bool
OnCollisionEnter ( Collision other ) : void

Collission handler

OnDrawGizmos ( ) : void
OnGUI ( ) : void
SetEnableMotion ( bool enable ) : void
Start ( ) : void
Update ( ) : void

Private Methods

Method Description
GetMaxTorque ( float currentRPM ) : float

Sample the RPM vs torque engine curve to get the torque for the current RPM value

Method Details

FixedUpdate() public method

public FixedUpdate ( ) : void
return void

GearsShift() public method

Shifts gear up or down according to speed.
public GearsShift ( ) : void
return void

IsFlying() public method

public IsFlying ( ) : bool
return bool

OnCollisionEnter() public method

Collission handler
public OnCollisionEnter ( Collision other ) : void
other Collision
return void

OnDrawGizmos() public method

public OnDrawGizmos ( ) : void
return void

OnGUI() public method

public OnGUI ( ) : void
return void

SetEnableMotion() public method

public SetEnableMotion ( bool enable ) : void
enable bool
return void

Start() public method

public Start ( ) : void
return void

Update() public method

public Update ( ) : void
return void

Property Details

brakePos public_oe property

public float brakePos
return float

brakingPower public_oe property

public float brakingPower
return float

cDrag public_oe property

public float cDrag
return float

cRoll public_oe property

public float cRoll
return float

carMass public_oe property

public float carMass
return float

centerOfMass public_oe property

public Transform centerOfMass
return Transform

currentGear public_oe property

public int currentGear
return int

currentSpeed public_oe property

public float currentSpeed
return float

differentialRatio public_oe property

public float differentialRatio
return float

driftAssist public_oe property

public float driftAssist
return float

engineTorque public_oe property

public float engineTorque
return float

gearRatio public_oe property

public float gearRatio
return float

gearsRatio public_oe property

public float[] gearsRatio
return float[]

handBrake public_oe property

public bool handBrake
return bool

maxGears public_oe property

public int maxGears
return int

maxSpeed public_oe property

public float maxSpeed
return float

maxTorque public_oe property

public float maxTorque
return float

maximumSpeed public_oe property

public int maximumSpeed
return int

peakTorque public_oe property

public float peakTorque
return float

playerNumber public_oe property

public int playerNumber
return int

rpm public_oe property

public float rpm
return float

rpmMax public_oe property

public float rpmMax
return float

rpmMin public_oe property

public float rpmMin
return float

steeringAngle public_oe property

public float steeringAngle
return float

steeringSensitityCurve public_oe property

public AnimationCurve steeringSensitityCurve
return AnimationCurve

steeringSensitivity public_oe property

public float steeringSensitivity
return float

throttlePos public_oe property

public float throttlePos
return float

torqueRPMCurve public_oe property

public AnimationCurve[] torqueRPMCurve
return AnimationCurve[]

virtualRPM public_oe property

public float virtualRPM
return float

wheels public_oe property

public WheelController[] wheels
return WheelController[]