예제 #1
0
        /// <summary>
        /// Updates recipes and display on skill level update.
        /// </summary>
        /// <param name="source"></param>
        public void ValueUpdated(Value <int> source)
        {
            if (source == skillBinder.skill.level)
            {
                if (expToNextLevelBox != null)
                {
                    skillBinder.skill.expToNextLevel.Set(skillBinder.skillData.expToLevel);
                }

                foreach (RecipeBinder recipeBinder in skillBinder.unlockedRecipeList)
                {
                    bool recipeSkillUnlockState = recipeBinder.CheckIfShouldBeUnlocked();

                    if (recipeSkillUnlockState || !recipeBinder.recipeData.hasSchematic)
                    {
                        recipeBinder.SetUnlocked(recipeSkillUnlockState);
                    }
                }
            }
            else
            {
                levelBox.UpdateMax(skillBinder.GetHighestUnlockedLevel());

                Controls.Remove(requirementTipsLabel);
                requirementTipsLabel = GetRequirementTipsLabel();
                Controls.Add(requirementTipsLabel);
            }
        }
예제 #2
0
 /// <summary>
 /// Updates the display to match the data.
 /// </summary>
 /// <param name="source"></param>
 public void ValueUpdated(Value <float> source)
 {
     if (source == stat.value)
     {
         stat.originalValue.Set(stat.value.Get());
     }
     else if (source == max.value)
     {
         valueBox.UpdateMax(max.value.Get());
     }
 }