| | |
| | | [SerializeField] Text processTxt;
|
| | | [SerializeField] Text lvTxt;
|
| | | [SerializeField] Button upgradeBtn;
|
| | | [SerializeField] ToggleButton tenUpgrade;
|
| | | [SerializeField] Transform operationObj;
|
| | | [SerializeField] Transform maxObj;
|
| | | FairyNewModel familyModel { get { return ModelCenter.Instance.GetModel<FairyNewModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | int maxCnt = 65000;
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | tenUpgrade.isOn = false;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | |
|
| | | close.AddListener(CloseClick);
|
| | | tenUpgrade.SetListener(ChooseTen);
|
| | | for (int i = 0; i < zhenyanBtns.Count; i++)
|
| | | {
|
| | | int index = i;
|
| | |
| | | Display();
|
| | | }
|
| | |
|
| | | private void ChooseTen()
|
| | | {
|
| | | tenUpgrade.isOn = !tenUpgrade.isOn;
|
| | | int lv = familyModel.GetZhenyanLV(familyModel.selectZhenfaType + 1);
|
| | | int exp = familyModel.GetZhenyanExp(familyModel.selectZhenfaType + 1);
|
| | | int needExp = FamilyZhenfaConfig.GetConfig(familyModel.selectZhenfaType + 1, lv).LVUpNeedExp;
|
| | |
|
| | | int selectItemID = familyModel.useItemsDict[familyModel.selectZhenfaType + 1][familyModel.selectItemIndex];
|
| | | var itemCount = packModel.GetItemCountByID(PackType.Item, selectItemID);
|
| | | itemCount = tenUpgrade.isOn ? Mathf.Min(10, itemCount) : Mathf.Min(itemCount, 1);
|
| | | int addExp = ItemConfig.Get(selectItemID).EffectValueA1 * itemCount;
|
| | | processTxt.text = string.Format("{0}/{1} +{2}", exp, needExp, UIHelper.AppendColor(TextColType.Green, addExp.ToString()));
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | |
| | |
|
| | | int selectItemID = familyModel.useItemsDict[familyModel.selectZhenfaType + 1][familyModel.selectItemIndex];
|
| | | var itemCount = packModel.GetItemCountByID(PackType.Item, selectItemID);
|
| | | itemCount = tenUpgrade.isOn ? Mathf.Min(10, itemCount) : Mathf.Min(itemCount, 1);
|
| | | itemCount = Mathf.Min(maxCnt, itemCount);
|
| | | int addExp = ItemConfig.Get(selectItemID).EffectValueA1 * itemCount;
|
| | | processTxt.text = string.Format("{0}/{1} +{2}", exp, needExp, UIHelper.AppendColor(TextColType.Green, addExp.ToString()));
|
| | | lvTxt.text = lv.ToString();
|
| | |
| | |
|
| | | int selectItemID1 = familyModel.useItemsDict[familyModel.selectZhenfaType + 1][familyModel.selectItemIndex];
|
| | | var itemCount1 = packModel.GetItemCountByID(PackType.Item, selectItemID1);
|
| | | itemCount1 = tenUpgrade.isOn ? Mathf.Min(10, itemCount1) : Mathf.Min(itemCount1, 1);
|
| | | itemCount1 = Mathf.Min(maxCnt, itemCount1);
|
| | | int addExp1 = ItemConfig.Get(selectItemID1).EffectValueA1 * itemCount1;
|
| | | processTxt.text = string.Format("{0}/{1} +{2}", exp, needExp, UIHelper.AppendColor(TextColType.Green, addExp1.ToString()));
|
| | |
|
| | |
| | | SysNotifyMgr.Instance.ShowTip("NotEnoughMaterial");
|
| | | return;
|
| | | }
|
| | | pack.ItemCount = tenUpgrade.isOn ? (ushort)Mathf.Min(10, itemCount) : (ushort)1;
|
| | | pack.ItemCount = (ushort)Mathf.Min(maxCnt, itemCount);
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | | }
|