public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Right)
     {
         cardDisplay.DisplayCardDetail();
     }
 }
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.button == PointerEventData.InputButton.Right)
        {
            cardDisplay.DisplayCardDetail();
        }

        if (eventData.button == PointerEventData.InputButton.Left)
        {
            cardChoiceUI.ChooseCard(cardDisplay.card);
        }
    }
Example #3
0
    /// <summary>
    ///
    /// Function handler for click events
    ///
    /// </summary>
    public void OnPointerClick(PointerEventData eventData)
    {
        //Right clicking on a card always shows the detail display
        if (eventData.button == PointerEventData.InputButton.Right)
        {
            if (CardDisplay == null)
            {
                UpgradeDisplay.DisplayUpgradeDetail();
            }
            else if (UpgradeDisplay == null)
            {
                CardDisplay.DisplayCardDetail();
            }
        }

        //Left click selects the card in hand. Can't click cards if UI locked
        if (eventData.button == PointerEventData.InputButton.Left && !isHidden)
        {
            switch (GameManager.instance.effectManager.ActiveEffect)
            {
            case EffectManager.ActiveEffectTypes.EnchantUnit:
                if (Card.Type == CardTypes.Unit)
                {
                    GameManager.instance.effectManager.EnchantUnit((Unit)Card);
                    CardDisplay.UpdateProperties();
                }
                break;

            case EffectManager.ActiveEffectTypes.ModifyCost:
                GameManager.instance.effectManager.ModifyCost(Card);
                break;

            default:
                if (!GameManager.instance.effectManager.IsUILocked)
                {
                    SelectDisplay();
                }
                break;
            }
        }
    }
Example #4
0
    /// <summary>
    ///
    /// Function handler for click events
    ///
    /// </summary>
    public void OnPointerClick(PointerEventData eventData)
    {
        //Right clicking on a card always shows the card detail display
        if (eventData.button == PointerEventData.InputButton.Right)
        {
            cardDisplay.DisplayCardDetail();
        }

        //Left clicking functionality varies depending on which part of the library you are in
        if (eventData.button == PointerEventData.InputButton.Left && (deckListUI != null && deckListUI.DeckEditMode || campaignManagerUI != null))
        {
            //If the loot generator UI is null, this means the card is in the library display, and as such, the card just needs to be added to the deck
            if (lootGeneratorUI == null)
            {
                var updatedDeck = GameManager.instance.deckManager.AddCardToPlayerDeck(deckListUI.DeckEditId.Value, cardDisplay.card.CardData);
                deckListUI.RefreshActiveDeckDetails(updatedDeck);
            }
            //If there is a loot generator, this means the card is being selected on the loot generator panel
            else
            {
                //Variance depending on if the card is selected already or not
                if (!isSelected)
                {
                    //Cannot select more than the maximum number of cards in the loot generator
                    if (!lootGeneratorUI.FullCardsSelected)
                    {
                        lootGeneratorUI.SelectLootCard(cardDisplay.card.CardData);
                        isSelected = true;
                        cardSelectionBorder.SetActive(true);
                    }
                }
                else
                {
                    lootGeneratorUI.RemoveLootCard(cardDisplay.card.CardData);
                    isSelected = false;
                    cardSelectionBorder.SetActive(false);
                }
            }
        }
    }