コード例 #1
0
    public void AddUnknownCardToHand()
    {
        var card = CardPrefabFactory.CreateCardPrefab(new UnknownCard(CardCodename.UNKNOWN), true);

        card.SetParent(PlayerHandGUI);
        _cardPlaceholders.Enqueue(card);
    }
コード例 #2
0
    public void OnPointerEnter(PointerEventData eventData)
    {
        // clear the preview panel
        foreach (Transform child in CardPreviewPanel)
        {
            Destroy(child.gameObject);
        }

        // add a scaled version of the card to the preview panel
        Transform clone = CardPrefabFactory.CreateCardPrefab(CardFactory.CreateCard(GetComponent <CardLink>().Card.CardCodename), false);

        clone.localScale = new Vector3(2, 2); // TODO - remove hard coding, work it out from sizes?
        clone.SetParent(CardPreviewPanel);
        clone.localPosition = new Vector3(0, 0, 0);
    }