Example #1
0
 // Use this for initialization
 void Awake()
 {
     current         = this;
     coinsLabel      = UIRoot.FindObjectOfType <UILabel> ();
     coinsLabel.text = PlayerPrefs.GetInt("coins").ToString("D4");
     sound           = SoundManager.manager.isSoundOn();
 }
Example #2
0
    // Use this for initialization
    void Awake()
    {
        current         = this;
        lifesController = UIRoot.FindObjectOfType <LifesController> ();
        //crystalController = UIRoot.FindObjectOfType<CrystalsController> ();

        pauseButton.signalOnClick.AddListener(this.settingsMenu);

        string str = PlayerPrefs.GetString(getSceneName() + "stats", null);

        this.stats = JsonUtility.FromJson <LevelStat> (str);
        if (this.stats == null)
        {
            this.stats = new LevelStat();
        }
        fruits    = stats.collectedFruits.Count;
        maxfruits = FindObjectsOfType <Fruit> ().Length;
    }