public void InitData(Item item, ItemIconType itemIconType) { Data = item; this.itemIconType = itemIconType; //ItemTableData itemTableData = DataManager.GetInstance().GetItemTableDataByItem(item); //ItemQuality itemQuality = (ItemQuality)itemTableData.quality; //switch (itemQuality) //{ // case ItemQuality.Black: // bg.color = new Color(0,0,0,1); // break; // case ItemQuality.Green: // bg.color = new Color(0, 1, 0, 1); // break; // case ItemQuality.Blue: // bg.color = new Color(0, 0, 1, 1); // break; // case ItemQuality.Purple: // bg.color = new Color(1, 0, 200.0f / 255.0f, 1); // break; // case ItemQuality.Yellow: // bg.color = new Color(1, 150.0f / 255.0f, 0, 1); // break; // case ItemQuality.Red: // bg.color = new Color(1, 0, 0, 1); // break; // default: // break; //} AddIcon(DataManager.GetInstance().GetItemTableDataByItem(item).icon); }
public Item() { itemId = 0; itemName = "Empty"; itemPrice = 0; itemType = Item.Itemtype.Empty; itemIconType = Item.ItemIconType.Empty; itemStats = new Dictionary<string, int>(); itemTextStats = ""; }
public Item(int id, string name, int price, Itemtype type, ItemIconType iconType, Dictionary<string, int> stats) { itemId = id; itemName = name; itemPrice = price; itemType = type; itemIconType = iconType; itemStats = stats; itemTextStats = GetItemStatsText(); }
public void InitData(Item item, ItemIconType itemIconType) { SetState(true); Data = item; ItemTableData itemTableData = DataManager.instance.GetItemTableDataByItemId(item.itemId); equipTextsArr[0].text = itemTableData.name; equipTextsArr[1].text = item.itemLevel.ToString(); this.itemIconType = itemIconType; AddIcon(DataManager.GetInstance().GetItemTableDataByItem(item).icon); }
// 物品item赋值 type哪里显示的物品, item为要显示资源框, itemid物品id, itemcount要显示的物品数量,-1默认不显示数量 public void SetItemInfo(ItemIconType type, UnityEngine.GameObject item, int itemId, int itemcount = -1) { if (item == null || itemId == 0) { return; } int nameType = 0; // 0:普通 1:s装备 , 2:碎片 UITexture icon = null; UISprite frame = null; UILabel num = null; UILabel lName = null; switch (type) { case ItemIconType.Task_Award: TaskAwardItem(item, out icon, out frame, out num); break; case ItemIconType.Sign_in: SignInItem(item, out icon, out frame, out num); nameType = 1; break; case ItemIconType.Store_item: StoreItem(item, out icon, out frame, out num); nameType = 1; break; case ItemIconType.Xhun_item: XhunItem(item, out icon, out frame, out num); break; case ItemIconType.Artifact: ArtifactItem(item, out icon, out frame, out num); break; case ItemIconType.Scene_Star: SceneStrarItem(item, out icon, out frame); break; case ItemIconType.Scene_Award: SceneAwardItem(item, out icon, out frame, out num); break; case ItemIconType.Scene_Award2: SceneAwardItem2(item, out icon, out frame, out num); break; case ItemIconType.Scene_First: SceneFirstItem(item, out icon, out frame); break; case ItemIconType.CombatWin: CombatWinItem(item, out icon, out frame, out num, out lName); break; case ItemIconType.Victory: VictorPanel(item, out icon, out frame, out lName, out num); break; case ItemIconType.Equip_slot: EquipSlot(item, out icon, out frame); nameType = 1; break; case ItemIconType.FightInfo_slot: nameType = 1; FightInfoSlot(item, out icon, out frame); break; case ItemIconType.Equip_List: nameType = 1; EquipListItem(item, out icon, out frame, out lName); break; case ItemIconType.Item_Property: ItemPropertySlot(item, out icon, out frame, out lName); break; case ItemIconType.Login_Award: LoginAwardSlot(item, out icon, out frame, out num); break; case ItemIconType.Item_Source: ItemSource(item, out icon, out frame, out lName); break; case ItemIconType.Partner_Strengthen: nameType = 1; PartnerStrengthen(item, out icon, out frame); break; case ItemIconType.Partner_Skill: nameType = 1; PartnerSkill(item, out icon, out frame, out lName); break; } ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(itemId); if (ic != null) { UnityEngine.Texture utt = GamePokeyManager.GetTextureByPicName(ic.m_ItemTrueName); if (utt != null && icon != null) { icon.mainTexture = utt; } if (frame != null) { if (ic.m_ShowType == 0) { if (nameType == 0) { frame.spriteName = "EquipFrame" + ic.m_PropertyRank; } else if (nameType == 1) { frame.spriteName = "SEquipFrame" + ic.m_PropertyRank; } } else if (ic.m_ShowType == 1) { frame.spriteName = "SFrame" + ic.m_PropertyRank; } } if (num != null) { if (itemcount > -1) { if (type == ItemIconType.Store_item) { num.text = "" + (itemcount > 1 ? itemcount.ToString() : ""); } else { num.text = "X" + itemcount; } } else { num.text = ""; } } if (lName != null) { lName.text = ic.m_ItemName; UnityEngine.Color col = new UnityEngine.Color(); switch (ic.m_PropertyRank) { case 1: col = new UnityEngine.Color(1.0f, 1.0f, 1.0f); break; case 2: col = new UnityEngine.Color(0x00 / 255f, 0xfb / 255f, 0x4a / 255f); break; case 3: col = new UnityEngine.Color(0x41 / 255f, 0xc0 / 255f, 0xff / 255f); break; case 4: col = new UnityEngine.Color(0xff / 255f, 0x00 / 255f, 0xff / 255f); break; case 5: col = new UnityEngine.Color(0xff / 255f, 0xa3 / 255f, 0x00 / 255f); break; default: col = new UnityEngine.Color(1.0f, 1.0f, 1.0f); break; } lName.color = col; } } }
public static void AddURLItem(ToolStripMenuItem menu, string itemName, string itemTip, ItemIconType type, string url) { Image itemIcon; switch (type) { case ItemIconType.Youtube: itemIcon = Properties.Resources.YotubeLogo; break; case ItemIconType.Bilibili: itemIcon = Properties.Resources.BilibiliLogo; break; case ItemIconType.Wechat: itemIcon = Properties.Resources.WechatLogo; break; case ItemIconType.GitHub: itemIcon = Properties.Resources.GithubLogo; break; default: itemIcon = Properties.Resources.BilibiliLogo; break; } AddURLItem(menu, itemName, itemTip, itemIcon, url); }