Esempio n. 1
0
    // 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;
        }
    }
Esempio n. 2
0
 protected override void OnRabitHit(HeroRabbit rabbit)
 {
     if (level == 1 || LevelStatsistics.load(level - 1).levelPassed)
     {
         SceneManager.LoadScene("Level" + level);
     }
 }
Esempio n. 3
0
    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();
    }
Esempio n. 5
0
    void Start()
    {
        LevelStatsistics stats = LevelStatsistics.load(LevelController.current.level);

        collectedCrystals = new HashSet <Crystal.Type> ();
        foreach (Crystal.Type type in stats.collectedCrystals)
        {
            addCrystal(type);
        }
    }