Beispiel #1
0
    private void Awake()
    {
        print("LevelDisplay.cs");
        int maxLevel = PlayerPrefsController.GetMaxLevel();

        levelText.text = "(Level " + maxLevel + ")";
    }
    private void DisplayStars()
    {
        int maxLevel = PlayerPrefsController.GetMaxLevel();

        for (int i = 0; i < maxLevel; i++)
        {
            DisplaySpecificStars(i);
        }
    }
Beispiel #3
0
    IEnumerator HandleWinCondition()
    {
        if (!levelLost)
        {
            winLabel.SetActive(true);
            GetComponent <AudioSource>().PlayOneShot(winSound);
            yield return(new WaitForSeconds(waitToLoad));

            PlayerPrefsController.SetMaxLevel(PlayerPrefsController.GetMaxLevel() + 1);
            FindObjectOfType <LevelLoader>().LoadNextScene();
        }
    }
    // index = 0 <=> currentLevel = 1
    private void SetLevelPrefs()
    {
        int indexLevel = PlayerPrefsController.GetLevelPrefs();
        int max_level  = PlayerPrefsController.GetMaxLevel();

        if (max_level - indexLevel <= 1)             //checking if it is last / maximum level
        {
            return;
        }
        int currentLevel = GetCurrentLevel();       //checking last enabled level

        if (currentLevel - 1 != indexLevel)
        {
            return;
        }
        indexLevel += 1;
        PlayerPrefsController.SetLevelPrefs(indexLevel);

        // FACEBOOK EVENT
        FacebookManager.Instance.LevelEnded(indexLevel);
    }
Beispiel #5
0
    public void LoadMaxLevel()
    {
        int maxLevel = PlayerPrefsController.GetMaxLevel();

        SceneManager.LoadScene("Level " + maxLevel);
    }