Example #1
0
        /// <summary>
        /// 点击伙伴转换按钮
        /// </summary>
        public void OnPartnerTransClick()
        {
            if (isOnDrag)
            {
                DragEndFunc();
            }
            //判断是否有足够角色
            if (tempTransData[0] != null && tempTransData[1] != null)
            {
                bool switchPeak = SelectSwitchPeak.gameObject.activeInHierarchy & SelectSwitchPeak.value;
                bool switchPo   = SelectSwitchPo.gameObject.activeInHierarchy & SelectSwitchPo.value;

                //判断角色的货币是否够
                int diamond = 0;
                DataLookupsCache.Instance.SearchIntByID("res.hc.v", out diamond);
                if (tranReplaceStone <= 0 && currCost > diamond)
                {
                    //钻石不够
                    //提示充值
                    BalanceResourceUtil.HcLessMessage();
                    return;
                }
                else
                {
                    //播放特效
                    //发送请求
                    int[] heroid = new int[2];

                    heroid[0] = tempTransData[0].HeroId;
                    heroid[1] = tempTransData[1].HeroId;
                    LTPartnerDataManager.Instance.PartnerTrans(heroid[0], heroid[1], SelectSwitchEquip.value, tranReplaceStone > 0, switchPeak, switchPo, delegate(bool sucess)
                    {
                        if (sucess)
                        {
                            //播放特效//刷新显示
                            StartCoroutine(PlayTransFx());
                            FusionAudio.PostEvent("UI/New/HuoBanZhuanHuan", true);
                            tempTransData[0].powerData.OnValueChanged(tempTransData[0], false, PowerData.RefreshType.All);
                            tempTransData[1].powerData.OnValueChanged(tempTransData[1], false, PowerData.RefreshType.All);
                            LTFormationDataManager.OnRefreshMainTeamPower(true);
                            Hotfix_LT.Messenger.Raise <int, bool>(Hotfix_LT.EventName.onPartnerCombatPowerUpdate, 0, false);
                            if (SelectSwitchEquip.value)
                            {
                                Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerEquipChange);
                            }
                        }
                    });
                }
            }
            else
            {
                //提示放入角色
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_PARTNER_TRANS_ADDPARTNERTIP"));
            }
        }
Example #2
0
 public void OnHandBookLevelUp()
 {
     if (canLevelup && nextHandBookInfo != null)
     {
         LTPartnerHandbookManager.Instance.MagicBookLevelUp(nextHandBookInfo.id, delegate
         {
             UpdateInfo(true);
             LTPartnerDataManager.Instance.OnDestineTypePowerChanged(Data.eRoleAttr.None, (prm) =>
             {
                 LTFormationDataManager.OnRefreshMainTeamPower(prm);
             }, true);
         });
     }
     else
     {
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_HANDBOOK_BTN_TIP2"));
     }
 }
Example #3
0
        private void UpdateInfo()
        {
            var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(Type);

            if (data == null)
            {
                EB.Debug.LogError("LTPartnerHandbookDetailCtrl.UpdateInfo data == null");
                return;
            }
            Hotfix_LT.Data.MannualBreakTemplate curThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel);
            if (curThrough == null)
            {
                EB.Debug.LogError("LTPartnerHandbookDetailCtrl.UpdateInfo curThrough == null");
                return;
            }
            BreakLevel            = data.BreakLevel;
            CurLevelLabel.text    = data.BreakLevel.ToString();
            curAddATKLabel.text   = string.Format("{0}%", Mathf.FloorToInt(curThrough.IncATK * 100));
            curAddDefLabel.text   = string.Format("{0}%", Mathf.FloorToInt(curThrough.IncDEF * 100));
            curAddMAXHPLabel.text = string.Format("{0}%", Mathf.FloorToInt((curThrough.IncMaxHp * 100)));

            Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1);
            if (breakThrough != null)//可升级
            {
                NextLevelLabe.gameObject.CustomSetActive(true);
                NextLevelLabe.text = (data.BreakLevel + 1).ToString();

                nextAddATKLabel.text   = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncATK - curThrough.IncATK) * 100));
                nextAddDefLabel.text   = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncDEF - curThrough.IncDEF) * 100));
                nextAddMaxHPLabel.text = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncMaxHp - curThrough.IncMaxHp) * 100));

                BreakItem.LTItemData = new LTShowItemData(breakThrough.material_1, breakThrough.quantity_1, LTShowItemType.TYPE_GAMINVENTORY, false);
                BreakItem.mDMono.gameObject.CustomSetActive(true);

                int    curCount  = GameItemUtil.GetInventoryItemNum(breakThrough.material_1);
                int    nextCount = breakThrough.quantity_1;
                string color     = curCount < nextCount ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                BreakItemLabel.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color, curCount, nextCount);
                RedPoint.CustomSetActive(curCount >= nextCount);
                BreakBtnBox.enabled = true;
                BreakBtnLabel.text  = EB.Localizer.GetString("ID_HANDBOOK_LEVEL_UP1");
            }
            else//不可升级
            {
                NextLevelLabe.gameObject.CustomSetActive(false);
                nextAddATKLabel.text   = string.Empty;
                nextAddDefLabel.text   = string.Empty;
                nextAddMaxHPLabel.text = string.Empty;

                BreakItem.mDMono.gameObject.CustomSetActive(false);
                RedPoint.CustomSetActive(false);
                BreakBtnBox.enabled = false;
                BreakBtnLabel.text  = EB.Localizer.GetString("ID_HAS_MAX_LEVEL");
            }

            cardData = data.CardsInfo;
            SetShowHandBookData();
            SetTurnPageText();
            if (isFristRegister)
            {
                isFristRegister = false;
                return;
            }
            LTPartnerDataManager.Instance.OnDestineTypePowerChanged(Type, (prm) =>
            {
                LTFormationDataManager.OnRefreshMainTeamPower(prm);
            }, true);
        }