Exemplo n.º 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();
    }
Exemplo n.º 2
0
    private void CityLoad()
    {
        Debug.Log("Load city");

        _pickaxesUpgradeController.LoadIndexes(LoadSystem.Load <PickaxesUpgradeData>("shopIndexes"));
        MoneyUpgradesController.LoadData(LoadSystem.Load <BankData>("bank"));
    }
Exemplo n.º 3
0
    private void CityLoad()
    {
        Debug.Log("Load city");

        _pickaxesUpgradeController.LoadIndexes(LoadSystem.Load <PickaxesUpgradeData>("shopIndexes"));
        MoneyUpgradesController.LoadData(LoadSystem.Load <BankData>("bank"));

        // we save city after player goes to city
        CitySave();
    }
        public void ContinuePressed()
        {
            var path = Application.persistentDataPath + "Player.data";

            if (!File.Exists(path))
            {
                return;
            }
            LoadSystem.Load();
            characterSetuper.SetupCharacter(ParameterManager.Instance.characterName);
            MoveToTheGameScene();
        }
Exemplo n.º 5
0
    private void GlobalLoad()
    {
        Debug.Log("Load global");

        extractedOresCounter.LoadOres(LoadSystem.Load <ExtractedOresData>("extractedOres"));

        SinglePlayerValues.LoadData(LoadSystem.Load <PlayerValuesData>("playerValues"));

        GameManager.LoadIndex(LoadSystem.Load <GameManagerData>("gameManager"));

        Statistics.LoadData(LoadSystem.Load <StatisticsData>("statistics"));

        AwakeningUpgradeController.LoadData(LoadSystem
                                            .Load <AwakeningUpgradeData>("awakeningUpgrades"));
    }
Exemplo n.º 6
0
    /// <summary>
    /// Bound to the button OnClick event
    /// If not new game, tries to load the file via ILoad
    /// ILoad loads new scene async, waits until completed
    /// Sets new scene activate, then moves moves/loads objects
    /// Unloads scene
    /// <para><param name="filename"> serialized file name</param></para>
    /// <para><param name="saveslot"> which file slot to load</param></para>
    /// </summary>
    void Load()
    {
        // If not new game, load game
        if (!newgame)
        {
            bool r = SAVELOAD.Load(filename);
            loadSystem.Load(saveslot);
            // Set fileName for new games
            SETTINGS.saveFileName = filename;
            SETTINGS.saveSlot     = saveslot;
            StartCoroutine(ILoad());
            return;
        }

        // If new game, first find an open slot
        if (newgame)
        {
            if (!SAVELOAD.LoadFileCheck("file1.steameng"))
            {
                SETTINGS.saveFileName = "file1.steameng";
                SETTINGS.saveSlot     = "1";
                StartCoroutine(ILoad());
                return;
            }
            if (!SAVELOAD.LoadFileCheck("file2.steameng"))
            {
                SETTINGS.saveFileName = "file2.steameng";
                SETTINGS.saveSlot     = "2";
                StartCoroutine(ILoad());
                return;
            }
            if (!SAVELOAD.LoadFileCheck("file3.steameng"))
            {
                SETTINGS.saveFileName = "file3.steameng";
                SETTINGS.saveSlot     = "3";
                StartCoroutine(ILoad());
                return;
            }
        }

        // Default Settings for New Games
        SETTINGS.saveFileName = "file1.steameng";
        SETTINGS.saveSlot     = "1";
        StartCoroutine(ILoad());
    }