예제 #1
0
파일: Muhon.cs 프로젝트: zuojiashun/src
    public static string GetMuhonLv(BaseItem baseItem)
    {
        if (!baseItem.IsMuhon)
        {
            return(string.Empty);
        }

        int level = (null != baseItem.ServerData)
            ? (int)baseItem.GetItemAttribute(GameCmd.eItemAttribute.Item_Attribute_WeaponSoul_Level) : 1;

        table.WeaponSoulUpgradeDataBase upgrade =
            DataManager.Manager <ItemManager>().GetLocalDataBase <table.WeaponSoulUpgradeDataBase>(baseItem.BaseId, level);

        if (null == upgrade)
        {
            return(string.Empty);
        }

        int max = (int)upgrade.maxLevel;

        if (level < max)
        {
            return(level.ToString());
        }
        else
        {
            return("满");
        }
    }
예제 #2
0
    private void UpdatePromote(Muhon data)
    {
        if (null == data)
        {
            return;
        }
        if (null == data.LocalUpgradeDataBase)
        {
            Engine.Utility.Log.Error(CLASS_NAME + "->upGradeDataBase null");
            return;
        }

        //刷新圣魂升级信息
        if (null != m_promoteGrow)
        {
            m_promoteGrow.SetGridData(data.QWThisID);
        }

        //刷新等级经验信息
        if (null != m_label_Level)
        {
            //当前等级:{0}/{1}   {2}需求等级:{3}
            ColorType cTye = ColorType.Green;
            if (DataManager.Instance.PlayerLv < data.BaseData.useLevel)
            {
                cTye = ColorType.Red;
            }
            string color = ColorManager.GetNGUIColorOfType(ColorType.Gray);
            m_label_Level.text = string.Format("{0}/{1}", data.Level, data.MaxLv);
            //= DataManager.Manager<TextManager>().GetLocalFormatText(LocalTextType.Local_TXT_Soul_Level
            //, data.Level, data.MaxLv, ColorUtil.GetNGUIColorOfType(cTye), data.BaseData.useLevel);
        }
        float expPercentage = (data.IsMaxLv) ? 1f : (float)data.Exp / data.UpgradeExp;

        if (null != m_label_PromoteExpPencentage)
        {
            m_label_PromoteExpPencentage.text = string.Format("{0}%", (expPercentage * 100).ToString("f1"));
        }
        if (null != m_slider_PromoteExpProgress)
        {
            SlideAnimation slideAnim = m_slider_PromoteExpProgress.GetComponent <SlideAnimation>();
            if (null != slideAnim)
            {
                slideAnim.DoSlideAnim(slideAnim.value, expPercentage);
            }
        }
        //刷新基础属性预览
        List <EquipDefine.EquipBasePropertyData> basePropertyList = emgr.GetWeaponSoulBasePropertyData(data.BaseId, data.Level);
        int count = (null != basePropertyList) ? basePropertyList.Count : 0;

        table.WeaponSoulUpgradeDataBase          nextUpgradeDataBase = null;
        List <EquipDefine.EquipBasePropertyData> nexBasePropertyList = null;

        if (!data.IsMaxLv)
        {
            nexBasePropertyList = emgr.GetWeaponSoulBasePropertyData(data.BaseId, data.Level + 1);
        }

        if (null != m_trans_BasePropertyLevel)
        {
            m_trans_BasePropertyLevel.Find("Content/Name").GetComponent <UILabel>().text    = "等级";
            m_trans_BasePropertyLevel.Find("Content/Current").GetComponent <UILabel>().text = data.Level + "";
            m_trans_BasePropertyLevel.Find("Content/Target").GetComponent <UILabel>().text  = (data.IsMaxLv) ? "满级" : "" + (data.Level + 1);
        }
        EquipDefine.EquipBasePropertyData temp = null;
        if (null != m_trans_BaseProperty1)
        {
            if (count >= 1)
            {
                temp = basePropertyList[0];
            }

            m_trans_BaseProperty1.Find("Content/Name").GetComponent <UILabel>().text    = (null != temp) ? temp.Name : "无";
            m_trans_BaseProperty1.Find("Content/Current").GetComponent <UILabel>().text = (null != temp) ? temp.ToString() : "无";
            m_trans_BaseProperty1.Find("Content/Target").GetComponent <UILabel>().text  = (!data.IsMaxLv && null != nexBasePropertyList && nexBasePropertyList.Count >= 1) ? nexBasePropertyList[0].ToString() : "满级";
        }
        if (null != m_trans_BaseProperty2)
        {
            if (count >= 2)
            {
                temp = basePropertyList[1];
            }

            m_trans_BaseProperty2.Find("Content/Name").GetComponent <UILabel>().text    = (null != temp) ? temp.Name : "无";
            m_trans_BaseProperty2.Find("Content/Current").GetComponent <UILabel>().text = (null != temp) ? temp.ToString() : "无";
            m_trans_BaseProperty2.Find("Content/Target").GetComponent <UILabel>().text  = (!data.IsMaxLv && null != nexBasePropertyList && nexBasePropertyList.Count >= 2) ? nexBasePropertyList[1].ToString() : "满级";
        }
        if (null != m_trans_BaseProperty3)
        {
            if (count >= 3)
            {
                temp = basePropertyList[2];
            }

            m_trans_BaseProperty3.Find("Content/Name").GetComponent <UILabel>().text    = (null != temp) ? temp.Name : "无";
            m_trans_BaseProperty3.Find("Content/Current").GetComponent <UILabel>().text = (null != temp) ? temp.ToString() : "无";
            m_trans_BaseProperty3.Find("Content/Target").GetComponent <UILabel>().text  = (!data.IsMaxLv && null != nexBasePropertyList && nexBasePropertyList.Count >= 3) ? nexBasePropertyList[2].ToString() : "满级";
        }
        if (null != m_trans_BaseProperty4)
        {
            if (count >= 4)
            {
                temp = basePropertyList[3];
            }

            m_trans_BaseProperty4.Find("Content/Name").GetComponent <UILabel>().text    = (null != temp) ? temp.Name : "无";
            m_trans_BaseProperty4.Find("Content/Current").GetComponent <UILabel>().text = (null != temp) ? temp.ToString() : "无";
            m_trans_BaseProperty4.Find("Content/Target").GetComponent <UILabel>().text  = (!data.IsMaxLv && null != nexBasePropertyList && nexBasePropertyList.Count >= 4) ? nexBasePropertyList[3].ToString() : "满级";
        }
    }