Exemplo n.º 1
0
 void EntryClickCallback(DecklistEntry entry)
 {
     // When an entry in the decklist is clicked, remove it
     m_decklist.Remove(entry);
     entry.RemoveOnClickEvent(EntryClickCallback);
     Destroy(entry.gameObject);
 }
Exemplo n.º 2
0
    public void AddCardToList(CardData card)
    {
        // Create the entry graphic
        RectTransform newEntry  = (RectTransform)Instantiate(m_entryPrefab, transform);
        DecklistEntry entryData = newEntry.GetComponent <DecklistEntry>();

        entryData.SetAsCard(card);
        entryData.SetOnClickEvent(EntryClickCallback);
        float yPos = -45 * (m_decklist.Count - 1) - 25;

        newEntry.anchoredPosition = new Vector3(0, yPos, 0);

        m_decklist.Add(entryData);
    }