Пример #1
0
    void InitPlayerInfo()
    {
        PlayerState state = userPackage.GetPlayerState();

        bloodProgess.value   = (float)state.blood / (float)(20 + 2 * state.health);
        bloodLabel.text      = string.Format("{0}/{1}", state.blood, 20 + 2 * state.health);
        hungerProgress.value = (float)state.hunger / (float)(20 + 2 * state.health);
        hungerLabel.text     = string.Format("{0}/{1}", state.hunger, 20 + 2 * state.health);
        thirstProgress.value = (float)state.thirst / (float)(20 + 2 * state.health);
        thirstLabel.text     = string.Format("{0}/{1}", state.thirst, 20 + 2 * state.health);
        interestLabel.text   = string.Format("分配比例:{0:f}%", (float)userPackage.GetPlayerInterest() * 100);
        resLabel.text        = GlobalFunction.NumberFormat(itemPackage.GetResourceTotolNumber());
        moneyLabel.text      = GlobalFunction.NumberFormat(itemPackage.GetGoldNumber());
        elecLabel.text       = string.Format("{0}/h", GlobalFunction.NumberFormat(sanctuaryPackage.GetTotalProEfficiency()));
        attackLabel.text     = state.attack.ToString();
        defenseLable.text    = state.defense.ToString();
        agileLabel.text      = state.agile.ToString();
        speedLabel.text      = state.speed.ToString();
        intellectLabel.text  = state.intellect.ToString();
        healthLabel.text     = state.health.ToString();
        moodLabel.text       = state.mood.ToString();
        loadLabel.text       = "0";
        float progress;

        userPackage.GetPlayerLevel(out progress);
        expProgress.value = progress;
        levelLabel.text   = string.Format("Lv.{0}", userPackage.GetPlayerLevel());
        expLabel.text     = string.Format("个人实力:{0}", userPackage.GetPersonContribution());
        nameLabel.text    = userPackage.GetUserInfo(userPackage.UserID).name;
    }
Пример #2
0
    void RefreshPlayerLevel(NDictionary data = null)
    {
        float progres = 0f;

        levelLabel.text      = string.Format("Lv.{0}", userPackage.GetPlayerLevel(out progres).ToString());
        expProgressBar.value = progres;
    }
Пример #3
0
    public int GetBuyLimit(int configID)
    {
        UserPackage userPackage = FacadeSingleton.Instance.RetrieveData(ConstVal.Package_User) as UserPackage;
        ITEM_RES    configData  = GetItemDataByConfigID(configID);
        var         dataMap     = ConfigDataStatic.GetConfigDataTable("PURCHASE_LIM");
        int         boughtNum;

        if (!mItemServerData.ContainsKey(configID))
        {
            boughtNum = 0;
        }
        else
        {
            boughtNum = mItemServerData[configID].boughtNum;
        }
        Type   type = Type.GetType("com.nkm.framework.resource.data.PURCHASE_LIM");
        string key  = configData.KeyName;

        if (key.Length <= 1)
        {
            key = key.ToUpper();
        }
        else
        {
            key = char.ToUpper(key[0]) + key.Substring(1);
        }
        PropertyInfo valInfo = type.GetProperty(key);
        int          res     = (int)valInfo.GetValue(dataMap[userPackage.GetPlayerLevel()], null) - boughtNum;

        if (res > 0)
        {
            return(res);
        }
        else
        {
            return(0);
        }
    }