public VehicleWheel(  WheelCollider vehicleWheel,
                       WheelComponent wheelComponent,
                       WheelPosition frontRear,
                       WheelPosition leftRight )
 {
     wheelFrontRear = frontRear;
     wheelLeftRight = leftRight;
     checkCurrentWheelState = WheelsOnGround.WHEEL_ON_GROUND;
     mainWheelCollider = vehicleWheel;
     wheelPhysicsComponent = wheelComponent;
     visualWheel = vehicleWheel.GetComponentInChildren<MeshRenderer>( ).transform;
     wheelRadius = ( visualWheel.GetComponent<Renderer>().bounds.size.y / 2 );
     mainWheelCollider.radius = wheelRadius;
     mainWheelCollider.GetGroundHit( out wheelGroundContactPoint );
 }
 private void UpdateWheelPosition ( )
 {
     if ( mainWheelCollider.GetGroundHit( out wheelGroundContactPoint ) )
     {
         checkCurrentWheelState = WheelsOnGround.WHEEL_ON_GROUND;
         return;
     }
     checkCurrentWheelState = WheelsOnGround.WHEEL_IN_AIR;
 }
 private int FindCurrentWheelState ( WheelsOnGround checkForWheelState )
 {
     int wheelOnGroundCount = 0;
     for ( int i = 0; i < vehicleWheels.Length; i++ )
     {
         if ( vehicleWheels[ i ].checkCurrentWheelState == checkForWheelState )
         {
             wheelOnGroundCount++;
         }
     }
     return wheelOnGroundCount;
 }