Beispiel #1
0
    public void ghostCarSpawning()
    {
        float timeIncrement = 0;

        ghostCar = new CarClass(platform, this, allStops[0], allStops[1]);

        for (int i = 0; i < allCars.Length; i++)
        {
            //If timeGap passes a spawn, it will increment with nextStop(), need parameters if it surpases more than one stop in an increment
            allCars[i] = new CarClass(platform, this, ghostCar.platform.transform, ghostCar.destination);
            allCars[i].currentStopNumber = ghostCar.currentStopNumber;
            timeIncrement += timeSpawnGap;
            ghostCar.canIMove(timeIncrement);
        }
        ghostCar.platform.gameObject.SetActive(false);
    }