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

        levelText.text = "(Level " + maxLevel + ")";
    }
예제 #2
0
    private void DisplayStars()
    {
        int maxLevel = PlayerPrefsController.GetMaxLevel();

        for (int i = 0; i < maxLevel; i++)
        {
            DisplaySpecificStars(i);
        }
    }
예제 #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();
        }
    }
예제 #4
0
    // 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);
    }
예제 #5
0
    public void LoadMaxLevel()
    {
        int maxLevel = PlayerPrefsController.GetMaxLevel();

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