public void InitSlider() { //Set max value of slider to next lvl xp xpSlider.maxValue = GameUtils.CalculateNextLevelXP(GameManager.SP.playerData.playerXP); Debug.Log("nxt LVL needed: " + GameUtils.CalculateNextLevelXP(GameManager.SP.playerData.playerXP)); xpSlider.minValue = GameUtils.GetXpForLevel(GameUtils.CalculateLevel(GameManager.SP.playerData.playerXP)); //Set value of lsider to right xp xpSlider.value = GameManager.SP.playerData.playerXP; goalValue = xpSlider.value; }
public void SetMenuText(bool _onBoot) { //Debug.Log(GameManager.SP.playerData.playerName); if (string.IsNullOrEmpty(GameManager.SP.playerData.playerName)) { ToggleNameInputPanel(true); } else { ToggleNameInputPanel(false); } //LANGTODO: playerNameText.text = "Name: " + GameManager.SP.playerData.playerName; xpText.text = "Level: " + GameUtils.CalculateLevel(GameManager.SP.playerData.playerXP); goldText.text = "Gold: " + GameManager.SP.playerData.gold; winText.text = "Wins: " + GameManager.SP.playerData.wins; float wl = 0; if (GameManager.SP.playerData.loses > 0) { wl = GameManager.SP.playerData.wins / GameManager.SP.playerData.loses; } else { wl = GameManager.SP.playerData.wins; } winLoseText.text = "Win/Lose: " + wl; if (_onBoot) { xpSlider.InitSlider(); } else { Debug.Log("Add earned xp"); } }