Esempio n. 1
0
    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";
        }
    }
Esempio n. 2
0
 private void OnMouseDown()
 {
     if (!EventSystem.current.IsPointerOverGameObject())
     {
         OnShopItemClicked.Invoke(item);
     }
 }
Esempio n. 3
0
 private void HandleClick() => OnShopItemClicked.Invoke(item);