Beispiel #1
0
 void Awake()
 {
     ZoneData.CreateZoneData(zoneSettings.zone);
     if (ZoneData.GetZoneData(zoneSettings.zone.zoneName) != null)
     {
         zone = (ZoneData.GetZoneData(zoneSettings.zone.zoneName));
     }
 }
Beispiel #2
0
    void Init()
    {
        float totalItem = 0;

        foreach (Level lvl in zone.levels)
        {
            totalItem += lvl.findItem;
        }

        textItem.text = totalItem + "/" + zone.itemGoal;

        string idZone = zone.zoneName;

        idZone = idZone.Substring(4);

        int id = 0;

        int.TryParse(idZone, out id);

        if (id > 1)
        {
            string prevZoneName = "Zone" + (id - 1);

            Zone prevZone = new Zone();
            if (ZoneData.GetZoneData(prevZoneName) != null)
            {
                prevZone = (ZoneData.GetZoneData(prevZoneName));
            }

            if (prevZone.missionComplete)
            {
                zone.unlockedZone = true;
            }

            ZoneData.UpdateZoneData(zone);
            zone = (ZoneData.GetZoneData(zoneSettings.zone.zoneName));
        }



        if (zone.unlockedZone)
        {
            GetComponent <Image>().color = Color.white;
        }
    }
        void Awake()
        {
            instance      = this;
            playerProfile = PlayerData.GetPlayerProfile();

            totalCoin    = GameObject.Find("TotalCoinUI");
            levelUIName  = GameObject.Find("LevelNameUI");
            starAnimator = GameObject.Find("StarUI").GetComponent <Animator>();
            parentUIItem = GameObject.Find("PanelItemsUI").transform;

            GameObject shieldUI = GameObject.Find("ShieldUI");

            shieldSprite = shieldUI.GetComponentInChildren <Image>();
            shieldUI.SetActive(levelSettings.haveShield);

            //levelUIName.GetComponent<Text>().text = level.levelName;

            parentUIGameOver  = GameObject.Find("PanelEndGameUI");
            parentUIGameScore = GameObject.Find("PanelSuccessGameUI");


            totalCoin.GetComponent <Text>().text = playerProfile.playerCoin.ToString();

            if (ZoneData.GetZoneData(levelSettings.zone) != null)
            {
                zone = (ZoneData.GetZoneData(levelSettings.zone));
            }

            foreach (Level lvl in zone.levels)
            {
                if (lvl.levelName == levelSettings.refLevelScene)
                {
                    levelSettings.level = lvl;
                }
            }
        }