public void SetWidgetData(CellPhoneActivityDefinition widgetData)
        {
            CellPhoneProgressionActivityDefinition cellPhoneProgressionActivityDefinition = widgetData as CellPhoneProgressionActivityDefinition;

            if (cellPhoneProgressionActivityDefinition != null)
            {
                this.widgetData = cellPhoneProgressionActivityDefinition;
                showLevelText();
                showTipText(this.widgetData.TipToken);
                loadIconPrefab();
                showMascotLevelProgress();
            }
        }
Ejemplo n.º 2
0
        private void addProgressionWidget(Dictionary <CellPhoneActivityDefinition, int> widgetToPriority)
        {
            ProgressionService progressionService = Service.Get <ProgressionService>();

            if (definition.ProgressionPriority != ActivityScreenPriorities.Hidden && progressionService.Level < progressionService.MaxUnlockLevel)
            {
                Mascot mascotClosestToNextLevel = getMascotClosestToNextLevel();
                if (mascotClosestToNextLevel != null && progressionService.MascotLevelPercent(mascotClosestToNextLevel.Name) >= definition.PercentToNextLevelToShowProgressionWidget)
                {
                    string tipForMascot = getTipForMascot(mascotClosestToNextLevel.Definition);
                    Reward rewardForProgressionLevel = getRewardForProgressionLevel(progressionService.Level + 1);
                    CellPhoneProgressionActivityDefinition cellPhoneProgressionActivityDefinition = ScriptableObject.CreateInstance <CellPhoneProgressionActivityDefinition>();
                    cellPhoneProgressionActivityDefinition.Mascot          = mascotClosestToNextLevel;
                    cellPhoneProgressionActivityDefinition.TipToken        = tipForMascot;
                    cellPhoneProgressionActivityDefinition.RewardItems     = rewardForProgressionLevel;
                    cellPhoneProgressionActivityDefinition.WidgetPrefabKey = definition.ProgressionWidgetKey;
                    widgetToPriority.Add(cellPhoneProgressionActivityDefinition, (int)definition.ProgressionPriority);
                }
            }
        }