// 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; }
void Awake() { controller = this; }