public void SetGridInfo(string ItemID, uint needNum = 1) { m_needNum = needNum; UIKnightLevelUPItemGrid grid = this; uint id = 0; if (uint.TryParse(ItemID, out id)) { ItemDataBase db = GameTableManager.Instance.GetTableItem <ItemDataBase>(id); if (db != null) { grid.Init(); grid.SetIcon(true, db.itemIcon); int num = DataManager.Manager <ItemManager>().GetItemNumByBaseId(id); string numstr = StringUtil.GetNumNeedString(num, needNum); grid.SetNum(true, numstr); string name = ItemDefine.GetItemBorderIcon(db.quality); grid.SetBorder(true, name); grid.ItemID = id; grid.ItemNum = (uint)num; grid.RegisterUIEventDelegate(UIItemInfoEventDelegate); //获取途径 if (num < needNum) { grid.SetNotEnoughGet(true); } else { grid.SetNotEnoughGet(false); } } } }
public static void GetQualityAtlasAsyn(uint qua, ref CMResAsynSeedData <CMAtlas> seedData, Action releaseAction, UISprite sprite, bool makePerfect = true) { string name = ItemDefine.GetItemBorderIcon(qua); GetAtlasAsyn(name, ref seedData, releaseAction, sprite, makePerfect); }
private void SetOpenData() { if (null == compoundSelectData) { return; } SetTransformState(true); ResetInfoGrid(); BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(compoundSelectData.BaseID); int attrNum = (null != compoundSelectData.Attrs) ? compoundSelectData.Attrs.Count : 0; SetIcon(true, baseItem.Icon); SetBorder(true, ItemDefine.GetItemBorderIcon((uint)attrNum)); if (compoundSelectData.IsBind) { SetBindMask(true); } if (null != m_TransDatas) { AttrTransData temData = null; GameCmd.PairNumber pair = null; EquipManager emgr = DataManager.Manager <EquipManager>(); for (int i = 0, max = m_TransDatas.Length; i < max; i++) { temData = m_TransDatas[i]; if (temData.Root == null) { continue; } if (null != compoundSelectData.Attrs && compoundSelectData.Attrs.Count > i) { if (!temData.Root.gameObject.activeSelf) { temData.Root.gameObject.SetActive(true); } pair = compoundSelectData.Attrs[i]; if (null != temData.Grade) { temData.Grade.text = emgr.GetAttrGrade(compoundSelectData.Attrs[i]).ToString(); } if (null != temData.Des) { temData.Des.text = emgr.GetAttrDes(compoundSelectData.Attrs[i]); } } else if (temData.Root.gameObject.activeSelf) { temData.Root.gameObject.SetActive(false); } } } SetSelect(m_bSelect); }
private void UpdateServerProperty() { uint bindMask = BindMask; m_bCanAuction = ItemDefine.isBindMaskEnable(GameCmd.enumItemBindType.BindItemType_Shop, bindMask); m_bCanSell2NPC = ItemDefine.isBindMaskEnable(GameCmd.enumItemBindType.BindItemType_Sell, bindMask); m_bCanStore2WareHouse = ItemDefine.isBindMaskEnable(GameCmd.enumItemBindType.BindItemType_Store, bindMask); m_bIsBind = bindMask != 0 && ItemDefine.IsBind(bindMask); m_QulityType = ItemDefine.ItemQualityType.White; int quality = 0; if (IsEquip) { quality = AdditionAttrCount; } else { quality = (int)BaseData.quality; } if (quality > (int)ItemDefine.ItemQualityType.White && quality < (int)ItemDefine.ItemQualityType.Max) { m_QulityType = (ItemDefine.ItemQualityType)quality; } m_strBorderIcon = ItemDefine.GetItemBorderIcon(QualityType); m_strName = GetNameNGUIColor() + LocalName; if (IsForgingEquip) { uint refineLevel = GetItemAttribute(GameCmd.eItemAttribute.Item_Attribute_RefineLevel); if (refineLevel > 0) { m_strName = m_strName + "+" + refineLevel; } } m_strNameForTips = GetNameNGUIColor(true) + LocalName; if (IsForgingEquip) { uint refineLevel = GetItemAttribute(GameCmd.eItemAttribute.Item_Attribute_RefineLevel); if (refineLevel > 0) { m_strNameForTips = m_strNameForTips + "+" + refineLevel; } } m_TipsTipIcon = ItemDefine.GetItemTipsTopIcon(QualityType); UpdateLocation(); }
public override void SetGridData(object data) { if (null == data) { return; } this.data = data as ItemDefine.UIItemCommonData; if (null != icon) { UIManager.GetTextureAsyn(this.data.IconName, ref m_iconCASD, () => { if (null != icon) { icon.mainTexture = null; } }, icon); } if (BorderIcon != null) { string bgName = ItemDefine.GetItemBorderIcon(this.data.Qulity); UIManager.GetAtlasAsyn(bgName, ref m_bgCASD, () => { if (null != BorderIcon) { BorderIcon.atlas = null; } }, BorderIcon); } if (null != num) { if (this.data.Num >= this.data.NeedNum) { num.text = this.data.Num >= 1 ? this.data.Num.ToString() : ""; if (getlable != null) { getlable.gameObject.SetActive(false); } if (blackSprite != null) { blackSprite.gameObject.SetActive(false); } } else { num.text = ""; SetShowGetWay(this.data.ShowGetWay); } } }
/// <summary> /// 钓上鱼了 /// </summary> void InitSuccessFishing() { m_trans_Center.gameObject.SetActive(true); //鱼 uint FishId = DataManager.Manager <FishingManager>().FishId; FishingDataBase fishingDb = GameTableManager.Instance.GetTableItem <FishingDataBase>(FishId); if (fishingDb != null) { // name m_label_fishname_label.text = fishingDb.strName; // icon UIManager.GetTextureAsyn(fishingDb.icon, ref m_iconAsynSeed, () => { if (null != m__icon) { m__icon.mainTexture = null; } }, m__icon, false); //border string borderName = ItemDefine.GetItemBorderIcon(fishingDb.borderId); UIManager.GetAtlasAsyn(UIManager.GetIconName(borderName, false), ref iuiBorderAtlas, () => { if (m_sprite_qualitybox != null) { m_sprite_qualitybox.atlas = null; } }, m_sprite_qualitybox, false); //积分 m_label_score_label.text = fishingDb.score.ToString(); //特效 PlayFishIconEffect(); } StartCoroutine(DelayToFalse()); }
public override void SetGridData(object data) { base.SetGridData(data); if (data is table.RideDataBase) { m_database = (table.RideDataBase)data; if (lableName != null) { lableName.text = m_database.name; } if (lableRate != null) { lableRate.text = DataManager.Manager <RideManager>().GetRideQualityStr(m_database.quality); } if (lableSpeed != null) { table.RideFeedData feeddata = GameTableManager.Instance.GetTableItem <table.RideFeedData>(m_database.rideID, 0); if (feeddata != null) { float value = (feeddata.speed / 100.0f); if (lableSpeed != null) { lableSpeed.text = value.ToString() + "%"; } } } if (icon != null) { UIManager.GetTextureAsyn(m_database.icon , ref iuiIconAtlas, () => { if (null != icon) { icon.mainTexture = null; } }, icon, true); } if (border != null) { string borderIconName = ItemDefine.GetItemBorderIcon(m_database.quality); UIManager.GetAtlasAsyn(borderIconName , ref iuiBorderAtlas, () => { if (null != border) { border.atlas = null; } }, border, true); } if (m_spriteGetTip != null) { m_spriteGetTip.enabled = !DataManager.Manager <RideManager>().ContainRide(m_database.rideID); } } }