예제 #1
0
        private void Update()
        {
            experienceText.text        = experience.GetExperience().ToString();
            experienceToLevelText.text = experience.GetExperienceToLevel().ToString();

            float expToLevel = experience.GetExperienceToLevel();

            expBar.localScale = new Vector3(Mathf.Approximately(expToLevel, 0f) ? 0f : experience.GetFraction(),
                                            1f,
                                            1f);
        }
예제 #2
0
        public int CalculateLevel()
        {
            if (experience == null)
            {
                return(currentLevel);
            }
            float currentXp        = experience.GetExperience();
            int   penultimateLevel = progression.GetLevels(StatsAtributte.ExperienceToLevelUp, charType);

            for (int level = 1; level <= penultimateLevel; level++)
            {
                float xpToLevelUp = progression.GetStat(StatsAtributte.ExperienceToLevelUp, charType, level);
                if (xpToLevelUp > currentXp)
                {
                    return(level);
                }
            }
            return(penultimateLevel + 1);
        }
예제 #3
0
        public int CalculateLevel()
        {
            if (experience == null)
            {
                return(startingLevel);
            }

            float currentXp        = experience.GetExperience();
            int   penultimateLevel = progression.GetLevels(Stat.ExperienceToLevelUp, characterClass);

            for (int level = 1; level <= penultimateLevel; level++)
            {
                float xpToLevelUp = progression.GetStat(Stat.ExperienceToLevelUp, characterClass, level);
                if (xpToLevelUp > currentXp)
                {
                    return(level);
                }
            }
            return(penultimateLevel + 1);
        }
예제 #4
0
파일: BaseStats.cs 프로젝트: SVell/Diabloid
        private int CalculateLevel()
        {
            if (exp == null)
            {
                return(startingLevel);
            }

            float currentXp = exp.GetExperience();

            for (int i = 1; i <= progression.GetLevels(Stat.ExperienceToLevelUp, characterClass); i++)
            {
                float xpToLevelUp = progression.GetStat(Stat.ExperienceToLevelUp, characterClass, i);
                if (xpToLevelUp > currentXp)
                {
                    return(i);
                }
            }

            return(progression.GetLevels(Stat.ExperienceToLevelUp, characterClass) + 1);
        }
예제 #5
0
        public int CalculateLevel()
        {
            Experience experience = GetComponent <Experience>();

            if (experience == null)
            {
                return(startingLevel);
            }
            float currentEXP       = experience.GetExperience();
            int   penultimateLevel = progression.GetLevels(Stat.ExperienceToLevelUp, characterClass);

            for (int levels = 1; levels <= penultimateLevel; levels++)
            {
                float expToLevelUp = progression.GetStat(Stat.ExperienceToLevelUp, characterClass, levels);
                if (expToLevelUp > currentEXP)
                {
                    return(levels);
                }
            }
            return(penultimateLevel + 1);
        }
예제 #6
0
 // Update is called once per frame
 void Update()
 {
     textDisplay.text = String.Format("{0}", experience.GetExperience());
 }
 void Update()
 {
     GetComponent <Text>().text = string.Format("{0:0}", experience.GetExperience());
 }
예제 #8
0
 private void SetExpText()
 {
     GetComponent <Text>().text = System.String.Format("{0}", experience.GetExperience());
 }
예제 #9
0
 // Update is called once per frame
 void Update()
 {
     GetComponent <Text>().text = experience.GetExperience().ToString();
 }
예제 #10
0
 private void Update()
 {
     GetComponent <Text>().text = Mathf.Round(experience.GetExperience()).ToString();
 }