public void ReadSegmentFromText(CSItem item, int segType, string text) { // StringStreamReader reader = new StringStreamReader(text); // switch ((ENItemSegmentType)segType) // { // case ENItemSegmentType.Level: // { // item.exp = reader.ReadInt(); // item.Level = reader.ReadInt(); // item.m_aptitude = reader.ReadInt(); // item.m_aptitudePer = reader.ReadFloat(); // item.m_isBind = reader.ReadBool(); // item.m_addPropData1 = reader.ReadInt(); // item.m_addPropData2 = reader.ReadInt(); // item.m_addPropData3 = reader.ReadInt(); // item.m_addPropData4 = reader.ReadInt(); // } // break; // case ENItemSegmentType.LevelFlag: // { // item.exp = reader.ReadInt(); // item.Level = reader.ReadInt(); // item.m_aptitude = reader.ReadInt(); // item.m_aptitudePer = reader.ReadFloat(); // item.m_isBind = reader.ReadBool(); // item.m_addPropData1 = reader.ReadInt(); // item.m_addPropData2 = reader.ReadInt(); // item.m_addPropData3 = reader.ReadInt(); // item.m_addPropData4 = reader.ReadInt(); // } // break; // default: // break; // } }
//按ID排序 public int Compare(SortableItem tmpx, SortableItem tmpy) { CSItem x = (CSItem)tmpx; CSItem y = (CSItem)tmpy; return(x.GotTime.CompareTo(y.GotTime)); }
void OnFriendListClickLongPressCard(object sender, EventArgs e) { GameObject obj = (GameObject)sender; Parma parma = obj.transform.parent.GetComponent <Parma>(); CSItem card = new CSItem(); FriendItem tmpFriendItem; if (FriendList.Singleton.m_friendListType == FriendList.EDITTYPE.enFriendList) { if (FriendList.Singleton.m_sortFriendList != null) { tmpFriendItem = (FriendItem)FriendList.Singleton.m_sortFriendList[parma.m_id]; card = tmpFriendItem.GetItem(); } else { tmpFriendItem = (FriendItem)FriendList.Singleton.m_friendInfoList[parma.m_id]; card = tmpFriendItem.GetItem(); } } else if (FriendList.Singleton.m_friendListType == FriendList.EDITTYPE.enApplyList) { ; } FriendList.Singleton.OnShowCardDetail(card); }
// 获得 对某个卡牌 赋予 经验值后 的等级和经验 public void GetLevelUpLVExp(CSItem card, int supplyExp, int breakCounts, out int level, out int exp) { level = 0; exp = 0; if (null == card) { return; } if (0 == supplyExp) { return; } int curLevel = card.Level; int curExp = card.Exp; LevelUpInfo info = GameTable.LevelUpTableAsset.LookUp(curLevel); HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); // 此卡 还可以突破的次数 int couldBreakCouts = heroInfo.BreakThroughCount - card.BreakCounts; if (couldBreakCouts > 0) { if (breakCounts > couldBreakCouts) { breakCounts = couldBreakCouts; } } int totalExp = supplyExp + curExp; int maxLevel = card.GetMaxLevel() + breakCounts * heroInfo.BreakThroughLevel; // 代表可以升级 if (totalExp > info.Monster_Exp) { // 用一个循环来算 100 是一个 够用范围 for (int i = 0; i < 100; i++) { // 不超过最大等级上限 if (curLevel >= maxLevel) { break; } info = GameTable.LevelUpTableAsset.LookUp(curLevel); curExp = totalExp - info.Monster_Exp; if (curExp < 0) { break; } totalExp = curExp; curLevel++; } } level = curLevel; exp = totalExp; }
//设置3D头像 void SetCard3DHead(CSItem card) { int childCount = m_beforModel.transform.childCount; for (int i = 0; i < childCount; i++) { Transform child = m_beforModel.transform.GetChild(i); GameObject.Destroy(child.gameObject); } AddModel(card, m_beforModel); int childCount1 = m_afterModel.transform.childCount; for (int i = 0; i < childCount1; i++) { Transform child = m_afterModel.transform.GetChild(i); GameObject.Destroy(child.gameObject); } HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.Log("UICardEvolution HeroInfo == null card.m_id:" + card.IDInTable); return; } CSItem tempCard = new CSItem(); tempCard.m_id = (short)info.EvolveChangeID; AddModel(tempCard, m_afterModel); }
//获得同ID的卡牌 用于段位升级公式一 public CSItem GetCardBuyIdCardDivisionFormula(CSItem card) { CSItem temp = null; foreach (CSItem item in m_items) { bool isInTeam = Team.Singleton.IsCardInTeam(item.m_guid); //不是最爱 不是代表 不是 在队伍中 并且卡牌ID相等 并且不是本身升段卡牌 if (!card.Love && !isInTeam && User.Singleton.RepresentativeCard != item.m_guid && card.m_id == item.m_id && card.m_guid != item.m_guid) { if (null == temp) { temp = item; } else { //找到等级最低并且升段次数最低的卡牌 if (item.BreakCounts < temp.BreakCounts) { temp = item; } else if (item.BreakCounts == temp.BreakCounts) { if (item.Level < temp.Level) { temp = item; } } } } } return(temp); }
//设置公式一升段素材 void SetFormulaOneMaterial(GradeUpRequireInfo info, CSItem card) { SetCostMoney(info.Formula1_Cost);//设置公式一升段所需金钱 //设置素材卡牌头像 与 段位升级卡头像相同 UICardHead tempCardHead = UICardHead.Create(); m_materialList.Add(tempCardHead);//加入到素材列表 tempCardHead.SetParent(m_materialSpritList[0].transform); tempCardHead.SetLocalPosition(Vector3.zero); //获得公式一卡牌 CSItem materialCard = User.Singleton.ItemBag.GetCardBuyIdCardDivisionFormula(card); CardDivisionUpdateProp.Singleton.AddMaterialCard(materialCard); if (null == materialCard) //如果背包里只有一张升段卡牌或者没有所需卡牌时 { tempCardHead.SetCardMask(true); //素材显示黑色遮罩 //升段确定按钮不可点击 m_buttonOk.isEnabled = false; //如果背包里面没有这张卡则创建一张只带有ID的卡牌从表里读取信息 CSItem tempCard = new CSItem(); tempCard.m_id = card.m_id; tempCardHead.SetCardInfo(tempCard); } else { m_materialSpritList[0].GetComponent <Parma>().m_type = 1; //如果表里有这张卡 则显示素材卡信息 tempCardHead.SetCardInfo(materialCard); } tempCardHead.RegisterCallBack(null, PressCardHead); tempCardHead.ShowCard(); tempCardHead.SetCardInfoShow(false); tempCardHead.SetCardLoveShow(false); }
//设置其他公式升段素材 void SetFormulaMaterial(GradeUpRequireInfo info, CSItem card, int formulaIndex) { FormulaInfo tempFormula = info.FormulaList[formulaIndex - 2]; if (null == tempFormula) { return; } //设置金币数量 int cost = tempFormula.Formula_Cost; SetCostMoney(cost); //设置素材卡牌 for (int i = 0; i < tempFormula.Param_Num; i++) { switch (tempFormula.ParamList[i].paramType) { case (int)MaterialType.enAppoint: AddAppointCard(m_materialSpritList[i], tempFormula.ParamList[i], i); break; case (int)MaterialType.enUnAppoint: AddUnAppoint(m_materialSpritList[i], tempFormula.ParamList[i]); break; case (int)MaterialType.enRingOfHonor: AddRingOfHonor(m_materialSpritList[i], tempFormula.ParamList[i]); break; default: break; } } }
// 获取 编辑队伍时的 选取的 队友所有消耗力 public int GetAllCost() { CSItem card = null; int leadship = 0; HeroInfo info = null; card = CardBag.Singleton.GetCardByGuid(m_bagMainSlotId); if (null != card) { info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); leadship = leadship + info.Cost; } card = CardBag.Singleton.GetCardByGuid(m_bagDeputySlotId); if (null != card) { info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); leadship = leadship + info.Cost; } card = CardBag.Singleton.GetCardByGuid(m_bagSupportSlotId); if (null != card) { info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); leadship = leadship + info.Cost; } return(leadship); }
public bool OnSortCondion(CSItem item) { HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.IDInTable); if (null == heroInfo) { Debug.LogWarning("null == heroInfo item.IDInTable:" + item.IDInTable); return(true); } // 收藏或者在编队中或者是代表卡 则不显示出来 if (item.Love || Team.Singleton.IsCardInTeam(item.Guid) || User.Singleton.RepresentativeCard == item.Guid) { return(true); } int occ = OperateCardList.Singleton.m_cardDivisionOcc; int level = OperateCardList.Singleton.m_cardDivisionLevel; int star = OperateCardList.Singleton.m_cardDivisionStar; if (heroInfo.Occupation == occ && item.Level == level && star == heroInfo.Rarity) { return(false); } return(true); }
public void InitSwitchSkillUI() { SkillBag.Clear(); SkillBag.Capacity = 1; CSItem card = CardBag.Singleton.GetCardByGuid(GUID); SkillInfo info = GameTable.SkillTableAsset.Lookup(card.SwitchSkillID); if (info != null) { SkillBag.Add(new ActorSkillInfo(info, card.SwitchSkillLevel)); } foreach (var item in card.SkillItemInfoList) { SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item.m_skillID); if (skillInfo == null) { continue; } if (skillInfo.SkillType == (int)ENSkillType.enPassive) {//被动技能 IResult r = BattleFactory.Singleton.CreateResult(ENResult.AddBuff, ID, ID, 0, 0, skillInfo.BuffIDList.ToArray()); if (r != null) { r.ResultExpr(skillInfo.BuffIDList.ToArray()); BattleFactory.Singleton.DispatchResult(r); } } } //通知UISwitchSkill //NotifyChanged((int)ENPropertyChanged.enSwitchSkill, null); }
public void UpdateTeamBagAllSlotId() { CSItemGuid guid = new CSItemGuid(); CSItem card = GetCard(m_curTeamIndex, EDITTYPE.enMain); if (card == null) { m_bagMainSlotId = guid; } else { m_bagMainSlotId = card.Guid; } card = GetCard(m_curTeamIndex, EDITTYPE.enDeputy); if (card == null) { m_bagDeputySlotId = guid; } else { m_bagDeputySlotId = card.Guid; } card = GetCard(m_curTeamIndex, EDITTYPE.enSupport); if (card == null) { m_bagSupportSlotId = guid; } else { m_bagSupportSlotId = card.Guid; } }
public void OnMsgSyncBattleHalper_CH2C(PacketReader p, object state) { Debug.Log("OnMsgSyncBattleHalper_CH2C"); int charID = p.ReadInt32(); string charName = p.ReadUTF8(16); int charLevel = p.ReadInt32(); int selectTimes = p.ReadInt32(); int helperType = p.ReadInt32(); int lastLoginTime = p.ReadInt32(); CSItem item = new CSItem(); item.Read(p); if (helperType == 0) { User.Singleton.HelperList.RemoveHelperCard(charID); } else { Helper helper = new Helper(); helper.m_userGuid = charID; helper.m_userName = charName; helper.m_userLevel = charLevel; helper.m_cardGuid = item.m_guid; helper.m_cardId = item.m_id; helper.m_cardLevel = item.Level; helper.m_cardBreakCounts = item.BreakCounts; helper.m_type = helperType; helper.m_chosenNum = selectTimes; User.Singleton.HelperList.AddHelperCard(helper); } }
// 解锁的技能列表 public void UnlockSkillList() { m_unlockSkillList.Clear(); CSItem card = CardBag.Singleton.GetCardByGuid(CardUpdateProp.Singleton.m_levelUpAfterGuid); if (null == card) { return; } int level = card.Level; HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == heroInfo) { return; } for (int i = 0; i < heroInfo.UnlockSkillLevelList.Count; i++) { int temp = heroInfo.UnlockSkillLevelList[i]; if (temp > m_oldLevel && temp <= level) { m_unlockSkillList.Add(heroInfo.AllSkillIDList[i]); } } }
// 记录 技能相关信息 void SetOldSkillData() { CSItem card = CardBag.Singleton.GetCardByGuid(m_curLevelGuid); if (null == card) { return; } m_skillDataList.Clear(); foreach (var item in card.SkillItemInfoList) { SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item.m_skillID); if (skillInfo == null) { continue; } // 如果是解锁技能 if (card.HaveSkill(item.m_skillID)) { m_skillDataList.Add(item.m_skillID, item.m_skillLevel); } } }
public int AddItem(CSItem item) { int slot = m_items.Count; m_items.Add(item); return(slot); }
// 更新单个格子 为队伍编辑 void UpdateTeamItem(CSItem card, Team.EDITTYPE type) { if (null != card && !SortByOccRace(card.IDInTable)) { // 格子不够增加格子 if (false == m_gridList.ContainsKey(m_tempIndex)) { ExpandOneGrid(); } UICardItem item = m_gridList[m_tempIndex]; HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == heroInfo) { Debug.LogWarning("UpdateTeamItem null == heroInfo item.IDInTable:" + card.IDInTable); } else { OperateCardList.Singleton.m_leadShipCost = OperateCardList.Singleton.m_leadShipCost + heroInfo.Cost; item.UpdateOperateTeam(card, m_cardSortUI.GetLastSortType(), type, m_tempIndex); OperateCardList.Singleton.m_hadItemList.Add(card.Guid); } m_tempIndex++; } }
public FriendItem CreateFriendItemData(int index) { FriendItem tmpFriendItem = new FriendItem(); tmpFriendItem.m_id = index; tmpFriendItem.m_level = index; tmpFriendItem.m_choiceCount = index; tmpFriendItem.m_beforLoadTime = 0; tmpFriendItem.m_actorName = index.ToString("00"); CSItem tmpCSItem = new CSItem(); int tmpIndex = 0; // int TableCount = GameTable.HeroInfoTableAsset.m_list.Count; // int randIndex = UnityEngine.Random.Range(0, TableCount); foreach (HeroInfo item in GameTable.HeroInfoTableAsset.m_list.Values) { if (index == tmpIndex) { tmpCSItem.IDInTable = (short)item.ID; break; } tmpIndex++; } // = (short)randIndex; tmpCSItem.Level = index; tmpFriendItem.m_itemData = tmpCSItem; return(tmpFriendItem); }
public void DeserializeFromText(string text) { m_items.Clear(); MyEquips.Singleton.myEquips.Clear(); StringStreamReader reader = new StringStreamReader(text); //byte version = reader.ReadByte(); int count = reader.ReadInt(); CSItemSegmentDefine segmentDef = CSItemSegmentDefine.Singleton; for (int index = 0; index < count; ++index) { CSItem item = new CSItem(); item.m_guid.m_lowPart = reader.ReadInt(); item.m_guid.m_highPart = reader.ReadInt(); item.m_id = reader.ReadShort(); item.m_flag = reader.ReadShort(); for (int seg = 0; seg <= segmentDef.MaxSegmentType; seg++) { if ((item.m_flag & (0x1 << seg)) > 0) { segmentDef.ReadSegmentFromText(item, seg, reader.ReadString()); } } } }
// 更新从operatecardList 中用的格子 public void UpdateOperate(CSItem item, ENSortType sortType, int index = 0) { if (null == item) { return; } int cardID = item.IDInTable; HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(cardID); if (null == heroInfo) { return; } m_index = index; Update(item, sortType, m_index); OperateCardList.Singleton.m_curChosenIndex = -1; // 已选择索引 if (OperateCardList.Singleton.m_curType == OperateCardList.TYPE.enCardLevelUpDataCardType) { OperateCardList.Singleton.m_curChosenIndex = OperateCardList.Singleton.LevelUpList.IndexOf(item.Guid) + 1; } else if (OperateCardList.Singleton.m_curType == OperateCardList.TYPE.enSellType) { OperateCardList.Singleton.m_curChosenIndex = OperateCardList.Singleton.m_sellList.IndexOf(item.Guid) + 1; } m_tag.spriteName = "" + OperateCardList.Singleton.m_curChosenIndex; m_param.m_id = (int)Team.EDITTYPE.enNone; // 使用中 m_chosen.SetActive(Team.Singleton.IsCardInTeam(item.Guid)); bool bShowShadow = false; if (OperateCardList.Singleton.m_curChosenIndex == 0) { if (OperateCardList.Singleton.m_chosenCardNum >= 10) { bShowShadow = true; } } m_shadow.SetActive(bShowShadow); m_break.text = Localization.Get("LevelBreak") + item.BreakCounts; m_break.gameObject.SetActive(true); m_tips.SetActive(false); m_mask.SetActive(false); m_shadow.SetActive(false); m_love.gameObject.SetActive(false); m_tag.gameObject.SetActive(true); }
public void SendDivisionUpdate() { CSItem card = CardBag.Singleton.GetCardByGuid(m_curDivisionCardGuid); //发送卡牌升段消息 MiniServer.Singleton.SendCardDivisionUpdate(card, m_curtFormula, m_allCardList); ClearChooseCardList(); }
void ShowBattleHelper(int userGUID) { Helper helper = User.Singleton.HelperList.LookupHelper(userGUID); if (helper == null) { Debug.Log("No this helper, id = " + userGUID.ToString()); ShowSelf(); return; } m_btnTeamLeaderModel.SetActive(false); m_btnCancelTeamLeaderMode.SetActive(false); m_btnSelectThis.SetActive(true); m_btnChangeCard.SetActive(false); //userinfo m_userName.text = helper.m_userName; m_userLevel.text = Localization.Get("CardLevel") + helper.m_userLevel.ToString(); m_labelGUID.text = "ID:" + helper.m_userGuid.ToString(); CSItem card = new CSItem(); card.Guid = helper.m_cardGuid; card.m_id = (short)helper.m_cardId; card.Level = helper.m_cardLevel; card.BreakCounts = helper.m_cardBreakCounts; card.m_segment.m_heroCard.m_skill = helper.m_cardSkill; //代表卡info // CSItemGuid cardGuid = User.Singleton.RepresentativeCard; // CSItem card = CardBag.Singleton.GetCardByGuid(cardGuid); if (card != null) { Debug.Log("RefreshInfo"); HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (info == null) { return; } int headImageID = info.headImageId; IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(headImageID); m_cardPortrait.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_cardName.text = info.StrName; m_cardLevel.text = card.Level.ToString(); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_raritySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); int occ = info.Occupation; int race = info.Type; string occName = GameTable.OccupationInfoAsset.LookUp(occ).m_name; string raceName = GameTable.RaceInfoTableAsset.LookUp(race).m_name; m_occAndRace.text = occName + " " + raceName; m_phyAttack.text = ((int)card.GetPhyAttack()).ToString(); m_magAttack.text = ((int)card.GetMagAttack()).ToString(); m_hp.text = ((int)card.GetHp()).ToString(); m_breakthroughTimes.text = card.BreakCounts.ToString(); } }
void UpdateInfo() { //设置卡牌晋级前卡牌头像 if (null == m_cardBeforHead) { m_cardBeforHead = UICardHead.Create(); m_cardBeforHead.SetParent(m_cardBefor); m_cardBeforHead.SetLocalPosition(Vector3.zero); } CSItem card = CardBag.Singleton.GetCardByGuid(CardEvolution.Singleton.m_curEvolutionGuid); if (null == card) { Debug.Log("UICardEvolution card == null card:" + CardEvolution.Singleton.m_curEvolutionGuid); return; } HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.Log("UICardEvolution HeroInfo == null card.m_id:" + card.IDInTable); return; } m_cardBeforHead.SetCardInfo(card); m_cardBeforHead.RegisterCallBack(null, PressCardHead); m_cardBeforHead.ShowCard(); m_cardBeforHead.SetCardInfoShow(false); m_cardBeforHead.SetCardLoveShow(false); //设置卡牌晋级后卡牌头像 if (null == m_cardAfterHead) { m_cardAfterHead = UICardHead.Create(); m_cardAfterHead.SetParent(m_cardAfter); m_cardAfterHead.SetLocalPosition(Vector3.zero); } CSItem tempCard = new CSItem(); tempCard.m_id = (short)info.EvolveChangeID; m_cardAfterHead.SetCardInfo(tempCard); m_cardAfterHead.RegisterCallBack(null, PressCardHead); m_cardAfterHead.ShowCard(); m_cardAfterHead.SetCardInfoShow(false); m_cardAfterHead.SetCardLoveShow(false); int costMoneny = info.EvolveNeedLevel * info.Rarity; //设置素材卡牌 SetMaterial(card); //设置金钱数量 SetCostMoney(costMoneny); //设置属性面板显示 SetCardPropPanel(card); //设置卡牌的3D模型 SetCard3DHead(card); //检查素材是否齐全 CheckMaterialEnough(card); }
// 更新卡牌界面相关信息 public void UpdateInfo(CSItemGuid guid) { CSItem cardInfo = CardBag.Singleton.itemBag.GetItemByGuid(guid); if (cardInfo == null) { return; } // 卡牌ID int id = cardInfo.IDInTable; HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id); if (null == info) { Debug.Log("UICard UpdateInfo HeroInfo 表数据没有 ID 为:" + id); return; } // 星级 SetRarity(info.Rarity); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (null == rarityInfo) { Debug.Log("UICard UpdateInfo RarityRelativeInfo 表数据没有 ID 为:" + id); return; } IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(info.ImageId); if (null == imageInfo) { return; } // 消耗 m_cardCost.text = info.Cost.ToString(); m_cardName.text = info.StrName.ToString(); m_card.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); // 计算生命值 float hp = cardInfo.GetHp(); m_cardHp.text = hp.ToString(); // 计算物理攻击力 float attack = cardInfo.GetPhyAttack(); m_cardAttack.text = attack.ToString(); Debug.Log("UICard UpdateInfo:" + info.StrName); }
public int Compare(SortableItem tmpx, SortableItem tmpy) { FriendItem friendItemx = (FriendItem)tmpx; // FriendItem friendItemy = (FriendItem)tmpy; CSItem x = friendItemx.GetItem(); CSItem y = friendItemx.GetItem(); return(x.GotTime.CompareTo(y.GotTime)); }
// 设置要显示的 卡牌详情的卡牌数据 bOnlyCancel是否只显示 返回按钮 public void SetShowCardData(CSItem card, bool bOnlyCancel = false) { // 只带 返回按钮 if (bOnlyCancel) { m_curOptinGuid = CSItemGuid.Zero; } m_cardForDetail = card; }
void OnButtonOK(GameObject obj) { bool isShowCommonMsgBox = false; CSItem card = CardBag.Singleton.GetCardByGuid(CardEvolution.Singleton.m_curEvolutionGuid); if (null == card) { Debug.Log("UICardEvolution card == null card:" + CardEvolution.Singleton.m_curEvolutionGuid); return; } HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.Log("UICardEvolution HeroInfo == null card.m_id:" + card.IDInTable); return; } Dictionary <int, int> evolveCardList = new Dictionary <int, int>(); foreach (var cardID in info.EvolveCardList) { if (evolveCardList.ContainsKey(cardID)) { ++evolveCardList[cardID]; } else { evolveCardList.Add(cardID, 1); } } //判断素材卡里是否有稀有素材 如果有 则弹出二次确认框 foreach (KeyValuePair <int, int> item in evolveCardList) { WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCardDivisionMaterialStarLevel); HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.Value); if (null != heroInfo && worldInfo.IntTypeValue <= heroInfo.Rarity) { isShowCommonMsgBox = true; } } if (isShowCommonMsgBox) { UICommonMsgBoxCfg boxCfg = m_buttonOk.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnCardEvolutionOK, OnCardEvolutionNO, boxCfg); string formulaText = Localization.Get("WarningOfTheMaterial"); UICommonMsgBox.GetInstance().GetMainText().SetHintText(formulaText); UICommonMsgBox.GetInstance().GetMainText().SetHintTextColor(Color.red); } else { //进入转菊花loading界面 Loading.Singleton.SetLoadingTips((int)LOADINGTIPSENUM.enJumpToBag); IMiniServer.Singleton.req_herocardEvolve(CardEvolution.Singleton.m_curEvolutionGuid); HideWindow(); } }
// 为队伍相关编辑 更新格子 void OnUpdateItemForTeam() { // 领导力消耗 OperateCardList.Singleton.m_leadShipCost = 0; m_tempIndex = 1; // 先显示满足条件的卡牌 int teamIndex = Team.Singleton.m_curTeamIndex; CSItem card = null; OperateCardList.Singleton.m_hadItemList.Clear(); // 队伍特殊 顺序特别设置 // 编辑整个队伍 if (Team.Singleton.m_curEditType == Team.EDITTYPE.enALL) { // 主角色 card = CardBag.Singleton.GetCardByGuid(Team.Singleton.m_bagMainSlotId); UpdateTeamItem(card, Team.EDITTYPE.enMain); // 副角色 card = CardBag.Singleton.GetCardByGuid(Team.Singleton.m_bagDeputySlotId); UpdateTeamItem(card, Team.EDITTYPE.enDeputy); // 支持角色 card = CardBag.Singleton.GetCardByGuid(Team.Singleton.m_bagSupportSlotId); UpdateTeamItem(card, Team.EDITTYPE.enSupport); } // 编辑队伍中的单个角色 else { // 格子不够增加格子 if (false == m_gridList.ContainsKey(m_tempIndex)) { ExpandOneGrid(); } // 第一个格子 是个X UICardItem item = m_gridList[m_tempIndex]; item.SetXForOperateTeam(); m_tempIndex++; // 已选 主角色 card = Team.Singleton.GetCard(teamIndex, Team.EDITTYPE.enMain); UpdateTeamItem(card, Team.EDITTYPE.enMain); // 已选 副角色 card = Team.Singleton.GetCard(teamIndex, Team.EDITTYPE.enDeputy); UpdateTeamItem(card, Team.EDITTYPE.enDeputy); // 已选 支持角色 card = Team.Singleton.GetCard(teamIndex, Team.EDITTYPE.enSupport); UpdateTeamItem(card, Team.EDITTYPE.enSupport); } }
// 添加显示模型 void AddModel(CSItem card, GameObject parent) { if (card == null || parent == null) { return; } UIManager.Singleton.HideModel(m_modelData.m_obj as GameObject); m_modelData.m_isFinish = false; UIManager.Singleton.AddModel(card.IDInTable, parent, m_modelData); }
// 添加显示模型 void AddModel(CSItem card, GameObject parent) { if (null == card || parent == null) { return; } GameResPackage.AsyncLoadObjectData data = new GameResPackage.AsyncLoadObjectData(); m_modelDataList.Add(data); UIManager.Singleton.AddModel(card.IDInTable, parent, data); }