Beispiel #1
0
    IEnumerator _Load(CustomLevel level, CarData car)
    {
        yield return(StartCoroutine(LoadGameLevel(level)));

        Scene activeScene = SceneManager.GetActiveScene();

        yield return(StartCoroutine(UnloadLevel(activeScene)));

        yield return(StartCoroutine(UnloadAllPlaceholders()));

        yield return(StartCoroutine(UnloadLoadingScreen()));

        LevelSettings levelSetup = LevelSettings.GetInstance();

        if (levelSetup)
        {
            levelSetup.SetCar(car);
            levelSetup.levelData = level;
            levelSetup.SetTitle(level.title);
        }
    }