// Use this for initialization void Start() { LevelStatsistics stats = LevelStatsistics.load(level); if (level == 1 || LevelStatsistics.load(level - 1).levelPassed) { Destroy(doorLock); } if (!stats.levelPassed) { Destroy(check); } if (stats.allFruitsCollected) { SpriteRenderer fruitRenderer = fruit.GetComponent <SpriteRenderer>(); fruitRenderer.sprite = fruitFilled; } if (stats.allCrystalsCollected) { SpriteRenderer crystalRenderer = crystal.GetComponent <SpriteRenderer>(); crystalRenderer.sprite = crystalFilled; } }
protected override void OnRabitHit(HeroRabbit rabbit) { if (level == 1 || LevelStatsistics.load(level - 1).levelPassed) { SceneManager.LoadScene("Level" + level); } }
void Start() { LevelStatsistics stats = LevelStatsistics.load(LevelController.current.level); isCollected = stats.collectedCrystals.Contains(type); if (isCollected) { this.CollectedHide(); } }
// Use this for initialization void Start() { LevelStatsistics stats = LevelStatsistics.load(LevelController.current.level); collectedFruits = new HashSet <int>(stats.collectedFruits); Fruit[] allFruits = GameObject.FindObjectsOfType <Fruit>(); this.totalFruits = allFruits.Length; totalFruitsLabel.text = totalFruits.ToString(); }
void Start() { LevelStatsistics stats = LevelStatsistics.load(LevelController.current.level); collectedCrystals = new HashSet <Crystal.Type> (); foreach (Crystal.Type type in stats.collectedCrystals) { addCrystal(type); } }