private void OnItemClick(BaseItem item) { OnButtonClick.Invoke(); if (currentPreviewItem) { currentPreviewItem.Previewing = false; } currentPreviewItem = item; OnCharacterItemChanged.Invoke(currentPreviewItem); item.Previewing = true; if (item.Selected) { buyOrSelectButton.SetActive(false); priceObj.SetActive(false); } else if (item.Unlocked) { buyOrSelectButton.SetActive(true); priceObj.SetActive(false); buyOrSelectButton.GetComponentInChildren <Text>().text = "Select"; } else { buyOrSelectButton.SetActive(true); priceObj.SetActive(true); priceObj.GetComponentInChildren <Text>().text = item.price.ToString(); buyOrSelectButton.GetComponentInChildren <Text>().text = "Buy"; } }
private void OnMouseDown() { if (!EventSystem.current.IsPointerOverGameObject()) { OnShopItemClicked.Invoke(item); } }
private void HandleClick() => OnShopItemClicked.Invoke(item);