static void Main(string[] args) { Vehicle vehicle = new Vehicle("Vehicle", "V1", 100, 10); StartVehicle(vehicle); StopVehicle(vehicle); VehicleV2 vehicleV2 = new VehicleV2("Vehicle", "V2", 120, 10); StartVehicle(vehicleV2); StopVehicle(vehicleV2); Car car = new Car("Chevrolet", "Spark", 120, 5, 4, CarType.Hatchback, TransmissionType.Manual); car.Start(); car.Stop(); Plane plane = new Plane("Boeing", "747", 500, 100, 10000, PlaneType.Commerical); plane.Start(); plane.Stop(); Boat boat = new Boat("I don't know boats", "Splish Splashy", 120, 10, BoatType.Yacht); boat.Start(); boat.Stop(); Hovercraft hovercraft = new Hovercraft("Rootem Scootem", "Dukem Nukem", 1000, 10); hovercraft.Start(); hovercraft.Stop(); Console.ReadLine(); }
public override void ApplyZone(Hovercraft hovercraft) { hovercraft.DamageHealth(damagePerSecond * Time.deltaTime); hovercraft.Rb.AddForce(-hovercraft.Rb.velocity * hovercraft.Rb.velocity.magnitude * dragCoeff); }
private void Awake() { Hovercraft = GetComponent <Hovercraft>(); instance = this; }
// Start is called before the first frame update void Start() { playerHovercraft = PlayerInput.Instance.Hovercraft; StartCoroutine(UpdateRoutine()); }
public override void ApplyZone(Hovercraft hovercraft) { hovercraft.Rb.AddForce(-hovercraft.Rb.velocity * hovercraft.Rb.velocity.magnitude * dragCoeff); }
public override void ApplyZone(Hovercraft hovercraft) { hovercraft.RestoreHealth(healsPerSecond * hovercraft.GetMaxHealth() * Time.deltaTime); }
public abstract void ApplyZone(Hovercraft hovercraft);
public override void ApplyZone(Hovercraft hovercraft) { hovercraft.Rb.AddForce(Vector3.up * jumpCoeff * hovercraft.Rb.velocity.magnitude * Physics.gravity.magnitude, ForceMode.Acceleration); }