58 lines
994 B
C#
58 lines
994 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public enum Gears{
|
|
Rear = -1,
|
|
Neutral = 0,
|
|
Gear1 = 1,
|
|
Gear2 = 2,
|
|
Gear3 = 3,
|
|
Gear4 = 4,
|
|
Gear5 = 5
|
|
}
|
|
|
|
public class GearboxDefault : Gearbox {
|
|
private float[] _gearRatios = new float[]{3.5f, 0.0f, 3.636f, 1.95f, 1.375f, 0.941f, 0.784f};
|
|
private int _currentGear = (int)Gears.Neutral;
|
|
|
|
public override float GetGearRatio (int gear)
|
|
{
|
|
throw new System.NotImplementedException ();
|
|
}
|
|
|
|
public override int Gear{
|
|
get{ return _currentGear;}
|
|
set{
|
|
if (_currentGear != value) {
|
|
_currentGear = value;
|
|
Debug.Log("Set gear to: " + (Gears)_currentGear);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override GearboxControlType ControlType {
|
|
get {
|
|
return GearboxControlType.Manual;
|
|
}
|
|
}
|
|
|
|
public override float MaxOutputTorque {
|
|
get {
|
|
return 600.0f;
|
|
}
|
|
}
|
|
|
|
public override int GearsCount {get {return _gearRatios.Length;}}
|
|
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
|
|
}
|
|
}
|