Exemple #1
0
    private void ButtonClicked(Button clickedButton)
    {
        LevelConfiguration level;

        buttonLevelPairs.TryGetValue(clickedButton, out level);
        if (level)
        {
            GameEconomy.curentLevel = level;
            Debug.Log(GameEconomy.curentLevel);
            if (level.startWithoutDescription)
            {
                loadingSceneUI.SetLoadingConfiguration(level);
                loadingSceneUI.gameObject.SetActive(true);
            }
            else
            {
                levelDescriptionUI.SetLevelConfiguration(level);
                levelDescriptionUI.gameObject.SetActive(true);
            }
        }
    }
    public void ContinueGame()
    {
        List <LevelConfiguration> levelConfigurations = Resources.LoadAll("Levels", typeof(LevelConfiguration)).Cast <LevelConfiguration>().ToList().OrderBy(u => u.levelNumber).ToList();

        for (int i = 0; i < levelConfigurations.Count; i++)
        {
            if (SaveSystem.LoadLevelStatucByID(levelConfigurations[i].levelSaveLoadID) == false || i == levelConfigurations.Count - 1)
            {
                if (levelConfigurations[i].startWithoutDescription)
                {
                    loadingSceneUI.SetLoadingConfiguration(levelConfigurations[i]);
                    loadingSceneUI.gameObject.SetActive(true);
                }
                else
                {
                    levelDescriptionUI.SetLevelConfiguration(levelConfigurations[i]);
                    levelDescriptionUI.gameObject.SetActive(true);
                }

                GameEconomy.curentLevel = levelConfigurations[i];
                break;
            }
        }
    }
Exemple #3
0
 public void LoadLevel()
 {
     loadingSceneUI.SetLoadingConfiguration(_levelConfiguration);
     loadingSceneUI.gameObject.SetActive(true);
 }