コード例 #1
0
ファイル: MainMenuXPSlider.cs プロジェクト: Huubertus14/Echo
    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;
    }
コード例 #2
0
ファイル: MainMenu.cs プロジェクト: Huubertus14/Echo
    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");
        }
    }