private void OnClickItem(GodSoldierItem item) { if (this.mLastSelectItem != null) { this.mLastSelectItem.IsSelect = false; } this.mLastSelectItem = item; if (this.mLastSelectItem != null) { this.mLastSelectItem.IsSelect = true; } }
private GodSoldierItem CreateItem(int itemId, long itemNum = 0L) { GodSoldierItem godSoldierItem = this.mItemList.Find((GodSoldierItem e) => e.get_name() == "Unused"); if (godSoldierItem == null) { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("GodSoldierItem"); UGUITools.SetParent(this.mItemGrid, instantiate2Prefab, false); godSoldierItem = instantiate2Prefab.GetComponent <GodSoldierItem>(); this.mItemList.Add(godSoldierItem); } godSoldierItem.get_gameObject().set_name(itemId.ToString()); godSoldierItem.get_gameObject().SetActive(true); godSoldierItem.SetData(itemId, itemNum); godSoldierItem.EventHandler = new Action <GodSoldierItem>(this.OnClickItem); return(godSoldierItem); }