private void OnEquipClick() { FashionTableItem res = DataManager.FashionTable[mSelectedId] as FashionTableItem; mModule.RequestEquip(SelectedId, mModule.GetEquipId(res.bodypart) == SelectedId ? 2 : 1); SoundManager.Instance.Play(15); }
private void RefreshPanel(int fashionid) { isDirty = false; FashionItemData itemdata; FashionTableItem res = DataManager.FashionTable[fashionid] as FashionTableItem; if (res == null) { return; } if (!mModule.GetFashionByID(fashionid, out itemdata)) { return; } FashionPropTableItem propRes = DataManager.FashionPropTable[res.propid + itemdata.starnum] as FashionPropTableItem; if (propRes == null) { return; } mFashionName2.text = res.name; mFlag.text = StringHelper.GetString(mModule.GetEquipId(res.bodypart) == fashionid ? "equiped" : "noequip"); mItemType.text = StringHelper.GetString("fashion_type"); int startLevel = Mathf.FloorToInt(itemdata.starnum / FashionDefine.Starnum_Per_Level) + 1; int startCount = (int)(itemdata.starnum % FashionDefine.Starnum_Per_Level); mStarNum.text = string.Format(StringHelper.GetString("startlevel"), StringHelper.GetString(startLevel.ToString())); SetStarBar(startCount); mCostTxt.text = StringHelper.GetString("fashioncost"); mCostNum.text = string.Format(StringHelper.GetString("costnum"), ItemManager.Instance.getItemName(res.costid), propRes.costnum); battleScore.text = propRes.battlescore.ToString(); mTip.text = res.desc2; mCurTxt.text = StringHelper.GetString("curprop"); mNextTxt.text = StringHelper.GetString("nextprop"); mTitle2.text = StringHelper.GetString("tiptitle"); mCurLife.text = StringHelper.GetString("life") + " " + propRes.life; mCurAttack.text = StringHelper.GetString("attack") + " " + propRes.fight; mCurDefence.text = StringHelper.GetString("defence") + " " + propRes.defence; mCurCritical.text = StringHelper.GetString("critical") + " " + propRes.critical; mCurPower.text = StringHelper.GetString("power") + " " + propRes.power; if (itemdata.starnum == res.max_stars) { mNexLife.gameObject.SetActive(false); mNextAttack.gameObject.SetActive(false); mNextDefence.gameObject.SetActive(false); mNextCritical.gameObject.SetActive(false); mNextPower.gameObject.SetActive(false); mCostTxt.gameObject.transform.localPosition = new Vector3(-7, 151, 0); mCostNum.gameObject.transform.localPosition = new Vector3(-7, 124, 0); } else { var nextProp = DataManager.FashionPropTable[res.propid + itemdata.starnum + 1] as FashionPropTableItem; if (nextProp == null) { return; } mNexLife.gameObject.SetActive(true); mNextAttack.gameObject.SetActive(true); mNextDefence.gameObject.SetActive(true); mNextCritical.gameObject.SetActive(true); mNextPower.gameObject.SetActive(true); mNexLife.text = StringHelper.GetString("life") + " " + nextProp.life; mNextAttack.text = StringHelper.GetString("attack") + " " + nextProp.fight; mNextDefence.text = StringHelper.GetString("defence") + " " + nextProp.defence; mNextCritical.text = StringHelper.GetString("critical") + " " + nextProp.critical; mNextPower.text = StringHelper.GetString("power") + " " + nextProp.power; mCostTxt.gameObject.transform.localPosition = new Vector3(-7, -21, 0); mCostNum.gameObject.transform.localPosition = new Vector3(-7, -61, 0); } }