Exemplo n.º 1
0
        protected override void PlaceCard(UICard card)
        {
            float xPos = -50 + cards.Count * 30;
            float yPos = -10;

            card.rect.position = transform.position + new Vector3(xPos, yPos, 0f);
        }
Exemplo n.º 2
0
 public override void AddCard(UICard card)
 {
     gameObject.SetActive(true);
     UnHighlightCards();
     base.AddCard(card);
     SelectCard(card);
 }
Exemplo n.º 3
0
        public static UICard InstantiateCard(Card card, Transform parent)
        {
            UICard UICard = Instantiate(Prefabs.Instance.card, parent).GetComponent <UICard>();

            UICard.InitCard(card);

            return(UICard);
        }
Exemplo n.º 4
0
        protected override void PlaceCard(UICard card)
        {
            int   i    = cards.IndexOf(card);
            float posX = GetCardPosX(i);
            float posY = GetCardPosY(i);

            card.rect.position          = rect.position + new Vector3(posX, posY, 0f);
            card.canvas.overrideSorting = false;
        }
Exemplo n.º 5
0
        public static UICard CreateCloseup(Card card, Vector3 position, float scaleMultiplier)
        {
            UICard closeup = Instantiate(Prefabs.Instance.card, UIMaster.Instance.transform).GetComponent <UICard>();

            closeup.InitCard(card);
            closeup.rect.localScale    *= scaleMultiplier;
            closeup.rect.position       = position;
            closeup.canvas.sortingOrder = 4;
            closeup.button.interactable = false;
            return(closeup);
        }
Exemplo n.º 6
0
        public IEnumerator ShowDamageCard(Card card, Player player)
        {
            UICard cardCloseup = UICard.CreateCloseup(card, new Vector3(9.2f * (Screen.width / 10), 6.2f * (Screen.height / 10), 0f), 1.5f);

            UIMaster.Instance.UpdateMultiButtonState(UIMultiButton.MultiButtonState.Ready);
            while (!player.ready)
            {
                yield return(null);
            }
            Destroy(cardCloseup.gameObject);
        }
Exemplo n.º 7
0
 public void SlotCard(UICard card)
 {
     // TODO: Move discarding check earlier in the slotting handling
     if (cards.Count > 0)
     {
         if ((card.cardData as CommandCard).cardColor != (cards[cards.Count - 1].cardData as CommandCard).cardColor)
         {
             ClearCards();
         }
         else if (cards.Count > 2)
         {
             RemoveCard(cards[0]);
         }
     }
     AddCard(card);
 }
Exemplo n.º 8
0
 public virtual void AddCard(UICard card)
 {
     card.SetParentPanel(this);
     cards.Add(card);
     PlaceCard(card);
 }
Exemplo n.º 9
0
 public virtual void CardClicked(UICard card)
 {
     Debug.Log("Card " + card + " clicked!");
 }
Exemplo n.º 10
0
 public override void CardClicked(UICard card)
 {
     CardSlotClicked();
     Debug.Log("Slotted card clicked: " + card.cardData.text);
 }
Exemplo n.º 11
0
 public override void CardClicked(UICard card)
 {
     SelectCard(card);
     (GameMaster.Instance.currentTurnState as TurnState_Draft).SetCurrentCard(card.cardData as CommandCard);
 }
Exemplo n.º 12
0
 protected override void PlaceCard(UICard card)
 {
     card.rect.position = transform.position + new Vector3(0f, 15 - 15 * cards.IndexOf(card), 0f);
 }
Exemplo n.º 13
0
 public override void RemoveCard(UICard card)
 {
     base.RemoveCard(card);
     Destroy(card.gameObject);
     UpdateCardValues();
 }
Exemplo n.º 14
0
 public override void AddCard(UICard card)
 {
     base.AddCard(card);
     card.SetHighlightState(UIHighlight.HighlightState.Inactive);
     UpdateCardValues();
 }
Exemplo n.º 15
0
 public virtual void RemoveCard(UICard card)
 {
     cards.Remove(card);
 }
Exemplo n.º 16
0
 protected virtual void PlaceCard(UICard card)
 {
     card.rect.position = rect.position;
     card.rect.parent   = rect;
 }
Exemplo n.º 17
0
 public override void CardClicked(UICard card)
 {
     (GameMaster.Instance.currentTurnState as TurnState_Draft).CardPicked(card.cardData as CommandCard);
     UIMaster.Instance.handPanel.AddCard(card);
     cards.Remove(card);
 }