Example #1
0
    private void ShowStrengthenView()
    {
        XEquip equip = GTDataManager.Instance.GetEquipDataByPos(mPosType, mPos);

        if (equip == null)
        {
            return;
        }
        if (MLEquip.Instance.IsFullStrengthenLevel(equip) == true)
        {
            return;
        }
        int itemID = equip.Id;

        GTItemHelper.ShowItemTexture(equipStrengthen.equipTexture, itemID);
        GTItemHelper.ShowItemQuality(equipStrengthen.equipQuality, itemID);
        GTItemHelper.ShowItemName(equipStrengthen.equipName, itemID);

        int costEquipNum = curStrengthenCostItems.Count;

        for (int i = 0; i < equipStrengthen.strengthenItems.Count; i++)
        {
            UCEquipItemStrengthen cell = equipStrengthen.strengthenItems[i];
            if (i < costEquipNum)
            {
                XItem mat = curStrengthenCostItems[i];
                cell.Show(true);
                int id = curStrengthenCostItems[i].Id;
                GTItemHelper.ShowItemTexture(cell.itemTexture, id);
                GTItemHelper.ShowItemQuality(cell.itemQuality, id);
                GTItemHelper.ShowItemNum(cell.itemNum, mat.Num);
            }
            else
            {
                cell.Show(false);
            }
        }
        DEquip            equipDB = ReadCfgEquip.GetDataById(itemID);
        DEquipStrengLevel levelDB = ReadCfgEquipStrengLevel.GetDataById(equipDB.Quality * 1000 + equip.StrengthenLevel + 1);
        int addExpNum             = MLEquip.Instance.GetStrengthenExpByMatList(curStrengthenCostItems);

        GTItemHelper.ShowItemTexture(equipStrengthen.costMoneyTexture, DEquip.EQUIP_STRENGTHEN_MONEY_ID_1);
        equipStrengthen.costMoneyNum.text       = addExpNum.ToString();
        equipStrengthen.equipStrengthLevel.text = GTTools.Format("强化等级 {0}", equip.StrengthenLevel);
        GTItemHelper.ShowProgressText(equipStrengthen.equipStrengthExp, equip.StrengthenExp, levelDB.RequireExp);
        GTItemHelper.ShowProgressSlider(equipStrengthen.equipStrengthExpBar, equip.StrengthenExp, levelDB.RequireExp);
        Dictionary <EAttr, int> propertys = GTAttrHelper.GetPropertys(equip);

        GTItemHelper.ShowEquipStrengthText(equipStrengthen.strengthText, itemID, equip.StrengthenLevel);
        GTItemHelper.ShowPropertyText(equipStrengthen.propertyText, propertys, true);
    }
Example #2
0
    protected override void OnAwake()
    {
        Transform pivot = transform.Find("Pivot");

        menuBtn1     = pivot.Find("MenuBtn/MenuBtn_1").gameObject;
        menuBtn2     = pivot.Find("MenuBtn/MenuBtn_2").gameObject;
        menuBtn3     = pivot.Find("MenuBtn/MenuBtn_3").gameObject;
        btnClose     = pivot.Find("BtnClose").gameObject;
        currFuncName = pivot.Find("Title").GetComponent <UILabel>();

        Transform strengthen = pivot.Find("View1");

        equipStrengthen.panel                 = strengthen.gameObject;
        equipStrengthen.equipTexture          = strengthen.Find("Equip/Texture").GetComponent <UITexture>();
        equipStrengthen.equipQuality          = strengthen.Find("Equip/Quality").GetComponent <UISprite>();
        equipStrengthen.costMoneyTexture      = strengthen.Find("Cost/Texture").GetComponent <UITexture>();
        equipStrengthen.costMoneyNum          = strengthen.Find("Cost/Num").GetComponent <UILabel>();
        equipStrengthen.btnAutoToAddMat       = strengthen.Find("Btn_AutoToAddMat").gameObject;
        equipStrengthen.btnStrengthen         = strengthen.Find("Btn_Strengthen").gameObject;
        equipStrengthen.btnStrengthenTenTimes = strengthen.Find("Btn_StrengthenTenTimes").gameObject;
        equipStrengthen.equipName             = strengthen.Find("EquipName").GetComponent <UILabel>();

        equipStrengthen.equipStrengthExpBar = strengthen.Find("Content0").GetComponent <UISlider>();
        equipStrengthen.equipStrengthLevel  = strengthen.Find("Content0/Level").GetComponent <UILabel>();
        equipStrengthen.equipStrengthExp    = strengthen.Find("Content0/Num").GetComponent <UILabel>();
        equipStrengthen.propertyText        = strengthen.Find("Content1/Text").GetComponent <UILabel>();
        equipStrengthen.strengthText        = strengthen.Find("Content2/Text").GetComponent <UILabel>();

        Transform itemsTrans = strengthen.Find("Items");

        for (int i = 1; i <= 6; i++)
        {
            UCEquipItemStrengthen item = new UCEquipItemStrengthen();
            item.itemBtn     = itemsTrans.Find("Item_" + i).gameObject;
            item.itemTexture = item.itemBtn.transform.Find("Texture").GetComponent <UITexture>();
            item.itemQuality = item.itemBtn.transform.Find("Quality").GetComponent <UISprite>();
            item.itemNum     = item.itemBtn.transform.Find("Num").GetComponent <UILabel>();
            item.itemPlus    = item.itemBtn.transform.Find("Plus").gameObject;
            equipStrengthen.strengthenItems.Add(item);
        }


        Transform advance = pivot.Find("View2");

        equipAdvance.panel              = advance.gameObject;
        equipAdvance.nowEquipTexture    = advance.Find("Now/Equip/Texture").GetComponent <UITexture>();
        equipAdvance.nowEquipQuality    = advance.Find("Now/Equip/Quality").GetComponent <UISprite>();
        equipAdvance.nowEquipName       = advance.Find("Now/EquipName").GetComponent <UILabel>();
        equipAdvance.nowEquipFightValue = advance.Find("Now/FightValue/Num").GetComponent <UILabel>();
        equipAdvance.nowEquipPropertys  = advance.Find("Now/Propertys").GetComponent <UILabel>();
        equipAdvance.nexEquipTexture    = advance.Find("Next/Equip/Texture").GetComponent <UITexture>();
        equipAdvance.nexEquipQuality    = advance.Find("Next/Equip/Quality").GetComponent <UISprite>();
        equipAdvance.nexEquipName       = advance.Find("Next/EquipName").GetComponent <UILabel>();
        equipAdvance.nexEquipFightValue = advance.Find("Next/FightValue/Num").GetComponent <UILabel>();
        equipAdvance.nexEquipPropertys  = advance.Find("Next/Propertys").GetComponent <UILabel>();
        equipAdvance.btnAdvance         = advance.Find("Btn_Advance").gameObject;

        equipAdvance.costEquipBtn     = advance.Find("Cost/Equip").gameObject;
        equipAdvance.costEquipNum     = advance.Find("Cost/Equip/Num").GetComponent <UILabel>();
        equipAdvance.costEquipTexture = advance.Find("Cost/Equip/Texture").GetComponent <UITexture>();
        equipAdvance.costEquipQuality = advance.Find("Cost/Equip/Quality").GetComponent <UISprite>();

        equipAdvance.costItemBtn      = advance.Find("Cost/Item").gameObject;
        equipAdvance.costItemNum      = advance.Find("Cost/Item/Num").GetComponent <UILabel>();
        equipAdvance.costItemTexture  = advance.Find("Cost/Item/Texture").GetComponent <UITexture>();
        equipAdvance.costItemQuality  = advance.Find("Cost/Item/Quality").GetComponent <UISprite>();
        equipAdvance.costMoneyNum     = advance.Find("Btn_Advance/Num").GetComponent <UILabel>();
        equipAdvance.costMoneyTexture = advance.Find("Btn_Advance/Texture").GetComponent <UITexture>();
        equipAdvance.advanceText      = advance.Find("Content0/Text").GetComponent <UILabel>();



        Transform equipStar = pivot.Find("View3");

        this.equipStar.panel             = equipStar.gameObject;
        this.equipStar.nowEquipTexture   = equipStar.Find("Now/Equip/Texture").GetComponent <UITexture>();
        this.equipStar.nowEquipQuality   = equipStar.Find("Now/Equip/Quality").GetComponent <UISprite>();
        this.equipStar.nowEquipName      = equipStar.Find("Now/EquipName").GetComponent <UILabel>();
        this.equipStar.nowEquipPropertys = equipStar.Find("Now/Propertys").GetComponent <UILabel>();
        this.equipStar.nexEquipTexture   = equipStar.Find("Next/Equip/Texture").GetComponent <UITexture>();
        this.equipStar.nexEquipQuality   = equipStar.Find("Next/Equip/Quality").GetComponent <UISprite>();
        this.equipStar.nexEquipName      = equipStar.Find("Next/EquipName").GetComponent <UILabel>();
        this.equipStar.nexEquipPropertys = equipStar.Find("Next/Propertys").GetComponent <UILabel>();

        equipStar.Find("Now/Stars").GetComponentsInChildren(this.equipStar.nowEquipStars);
        equipStar.Find("Next/Stars").GetComponentsInChildren(this.equipStar.nexEquipStars);

        this.equipStar.btnUpStar        = equipStar.Find("Btn_UpStar").gameObject;
        this.equipStar.costMoneyNum     = equipStar.Find("Btn_UpStar/Num").GetComponent <UILabel>();
        this.equipStar.costMoneyTexture = equipStar.Find("Btn_UpStar/Texture").GetComponent <UITexture>();

        this.equipStar.costItemBtn     = equipStar.Find("Cost/Item").gameObject;
        this.equipStar.costItemTexture = equipStar.Find("Cost/Item/Texture").GetComponent <UITexture>();
        this.equipStar.costItemQuality = equipStar.Find("Cost/Item/Quality").GetComponent <UISprite>();
        this.equipStar.costItemNum     = equipStar.Find("Cost/Item/Num").GetComponent <UILabel>();
        this.equipStar.starText        = equipStar.Find("Content0/Text").GetComponent <UILabel>();
    }