예제 #1
0
    private void MineLoad()
    {
        if (GameManager.previousSceneIndex != 0) // if we load not from main menu
        {
            return;
        }

        Debug.Log("Load mine");

        _chancesGenerator.LoadChances(LoadSystem.Load <ChancesData>("chances"));

        generateLevel.LoadLevelPrefab(LoadSystem.Load <LevelPrefabData>("level").seed);

        PlayerPositionData playerPositionData =
            LoadSystem.Load <PlayerPositionData>("player");

        if (playerPositionData != null)
        {
            playerGO.transform.position = new Vector3(playerPositionData.position[0],
                                                      playerPositionData.position[1],
                                                      playerPositionData.position[2]);
        }

        _gridBehavior.LoadGrid(LoadSystem.Load <GridData>("grid"));

        oreGenerator.LoadOres(LoadSystem.Load <OresData>("ores"));


        _nextLevelLoadController.LoadDescent(LoadSystem.Load <DescentData>("descent"));

        progressBar.LoadProgressBar(LoadSystem.Load <ProgressBarData>("progressBar"));

        SaveBaseOnCurrentScene();
    }