private void Add(ItemThings itemThings) { if (listPool.Find(item => item == itemThings) == null) { listPool.Add(itemThings); } UpdateList(); }
private void InitItemsThings(int count) { listItemThings = new List <ItemThings>(); for (int i = 0; i < count; i++) { ItemThings itemThings = Instantiate(prefabItem, transform); itemThings.SetImage(IconManager.GetRandomSprite1x1()); listItemThings.Add(itemThings); } listPool = new List <ItemThings>(listItemThings); }
private void UpdateList() { ItemThings itemThings = listPool.Find(item => item.ItemCaseParent != null); if (itemThings != null) { listPool.Remove(itemThings); } if (listPool.Count == 0) { //TODO EventManager.OnShowButtonGo(true); } else { EventManager.OnShowButtonGo(false); } }
public void OnDrop(PointerEventData eventData) { if (eventData.pointerDrag != null) { if (!isBusy) { SetBusy(true); ItemThings itemThings = eventData.pointerDrag.GetComponent <ItemThings>(); itemThings.SetParent(rectTransform); itemThings.SetItemCase(this); //? SetModeItemCase(ModeItemCase.Added); // Update ListItemThings EventManager.OnUpdateListThings(); } } }
public static void OnAddedItemThings(ItemThings itemThings) { Action <ItemThings> tmp = AddedItemThings; tmp?.Invoke(itemThings); }