Exemplo n.º 1
0
 public void ManageTraffic(float m)
 {
     currentSpawnTimer += Time.deltaTime;
     if (currentSpawnTimer >= TimeTillSpawn)
     {
         currentSpawnTimer = 0;
         TimeTillSpawn     = UnityEngine.Random.Range(5f, 10f);
         CarInfo         i          = RoadwayTrafficBeepBeep.CarsToSpawn.Dequeue();
         VehicleBehavior newVehicle = i.GenerateCar(SpawnPosition, false, m);
         newVehicle.CarInformation = i;
         newVehicle.SetVehicleValues(Destination.position, i.MaxSpeed);
         CarsSpawned.Add(newVehicle);
     }
 }