Esempio n. 1
0
        public void DebugSaveLevelData()
        {
            DebugSaveZoneData();

            if (currentLevel.levelStar > 2)
            {
                currentLevel.isCompleted = true;
            }

            StageData currentStageData = StageSave.GetStageData(currentZone.zoneName);

            if (currentStageData == null)
            {
                return;
            }

            for (int i = 0; i < currentStageData.levels.Count; i++)
            {
                //CURRENT LEVEL
                if (currentStageData.levels[i].ID == currentLevel.ID)
                {
                    if (currentLevel.levelStar > 0)
                    {
                        //IF STAR COUNT BLA BLA BLA
                        if (currentLevel.levelStar > currentStageData.levels[i].levelStar)
                        {
                            currentZone.zoneStarSaved = (currentZone.zoneStarSaved - currentStageData.levels[i].levelStar) + currentLevel.levelStar;
                        }

                        currentStageData.zone      = currentZone;
                        currentStageData.levels[i] = currentLevel;

                        //NEXT LEVEL UNLOCK
                        int index = i + 1;
                        if (index < currentStageData.levels.Count)
                        {
                            currentStageData.levels[index].isUnlocked = true;
                        }


                        StageSave.UpdateStageData(currentStageData);
                    }
                }
            }
        }
Esempio n. 2
0
        public void DebugSaveZoneData()
        {
            if (currentZone.zoneStarSaved >= currentZone.zoneStarGoal)
            {
                currentZone.isCompleted = true;
            }

            StageData nextStageData = StageSave.GetStageData("Zone" + (currentZone.ID + 1));

            if (nextStageData == null)
            {
                return;
            }

            if (currentZone.isCompleted)
            {
                nextStageData.zone.isUnlocked = true;
                StageSave.UpdateStageData(nextStageData);
            }
        }