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); }
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); }
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); }
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); }
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); }
// 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()); }
private void SetExpText() { GetComponent <Text>().text = System.String.Format("{0}", experience.GetExperience()); }
// Update is called once per frame void Update() { GetComponent <Text>().text = experience.GetExperience().ToString(); }
private void Update() { GetComponent <Text>().text = Mathf.Round(experience.GetExperience()).ToString(); }