Пример #1
0
    public void DoLevel(int index)
    {
        Time.timeScale = 1;
        Ui.WinScreen.SetActive(false);

        CancelGhost();

        Level      = Levels.Data[index];
        LevelIndex = index;
        Traffic    = FindObjectOfType <Traffic>();
        Traffic.Initialize(Traffic.Generate(Level));

        Money           = Level.StartMoney;
        CarGoal         = Level.CarGoal;
        TimeGoal        = Level.TimeGoal;
        CarsFerried     = 0;
        AverageTripTime = 0;
        TripTimes.Clear();

        var spawner = FindObjectOfType <EnemySpawner>();

        spawner.StartWaves();
    }