// 新增\数量改变,不包括删除 public void psstNotifyOneCardTujianInfoCmd(uint id, byte num) { TableItemBase tableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, id); if (tableItem != null) { if (!m_id2CardDic.ContainsKey(id)) { CardItemBase item = new CardItemBase(); item.m_tujian = new t_Tujian(); item.m_tujian.id = id; item.m_tujian.num = num; item.m_tableItemCard = tableItem.m_itemBody as TableCardItemBody; m_cardListArr[item.m_tableItemCard.m_career].Add(item); m_id2CardDic[id] = item; } m_id2CardDic[id].m_tujian.num = num; } else { Ctx.m_instance.m_logSys.error("psstNotifyOneCardTujianInfoCmd 不能查找到卡牌 Item"); } // 更新卡牌图鉴中的显示 IUITuJian uiTuJian = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian; if (uiTuJian != null) { uiTuJian.updateMidCardModel(); } }
override public void createCard(CardItemBase cardItem, GameObject pntGo_) { base.createCard(cardItem, pntGo_); UtilApi.setLayer(m_model.selfGo, Config.UIModelLayer); //UtilApi.setScale(gameObject.transform, new Vector3(0.24f, 1, 0.24f)); this.cardItemBase = cardItem; addEventHandle(); }
// 这个是界面中卡牌创建流程, createCard 等同于 setIdAndPnt,所有 setIdAndPnt 中设置的值都需要在 createCard 中进行设置 virtual public void createCard(CardItemBase cardItem, GameObject pntGo_) { m_modelPath = Ctx.m_instance.m_dataPlayer.m_dataCard.m_sceneCardModelAttrItemList[cardItem.m_tableItemCard.m_type].m_handleModelPath; setTableItemAndPnt(cardItem.m_tableItemCard, pntGo_); AuxLabel numText = null; numText = new AuxLabel(m_model.selfGo, "UIRoot/NumText"); // 卡牌数量 numText.text = "X" + cardItem.m_tujian.num.ToString(); }
public void psstNotifyAllCardTujianInfoCmd(List <t_Tujian> list) { clearAllTuJian(); CardItemBase item = null; int idx = 0; TableItemBase tableItem = null; while (idx < list.Count) { tableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, list[idx].id); if (tableItem != null) { item = new CardItemBase(); item.m_tujian = list[idx]; item.m_tableItemCard = tableItem.m_itemBody as TableCardItemBody; m_cardListArr[item.m_tableItemCard.m_career].Add(item); m_id2CardDic[list[idx].id] = item; } else { Ctx.m_instance.m_logSys.log("表格读取失败"); } ++idx; } // 更新卡牌图鉴中的显示 IUITuJian uiTuJian = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian; if (uiTuJian != null) { uiTuJian.updateMidCardModel(); } }
public void psstNotifyAllCardTujianInfoCmd(List<t_Tujian> list) { clearAllTuJian(); CardItemBase item = null; int idx = 0; TableItemBase tableItem = null; while(idx < list.Count) { tableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, list[idx].id); if (tableItem != null) { item = new CardItemBase(); item.m_tujian = list[idx]; item.m_tableItemCard = tableItem.m_itemBody as TableCardItemBody; m_cardListArr[item.m_tableItemCard.m_career].Add(item); m_id2CardDic[list[idx].id] = item; } else { Ctx.m_instance.m_logSys.log("表格读取失败"); } ++idx; } // 更新卡牌图鉴中的显示 IUITuJian uiTuJian = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian; if(uiTuJian != null) { uiTuJian.updateMidCardModel(); } }
protected int cmpCardFunc(CardItemBase a, CardItemBase b) { int ret = 0; if(a.m_tableItemCard.m_magicConsume < b.m_tableItemCard.m_magicConsume) { ret = -1; } else if(a.m_tableItemCard.m_magicConsume > b.m_tableItemCard.m_magicConsume) { ret = 1; } else // 相等 { if(a.m_tujian.id < b.m_tujian.id) { ret = -1; } else if(a.m_tujian.id > b.m_tujian.id) { ret = 1; } else { ret = 0; } } return ret; }