using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BattlePlayerControls : MonoBehaviour { public GameObject uiCanvas; public GameObject cardPrefab; public delegate void CardUsedAction(int i); public event CardUsedAction OnCardUsed; private List cardsInHand; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void SetHand(int numberOfCards) { this.cardsInHand = new List(); for (int i = 0; i < numberOfCards; i++) { GameObject newCard = Instantiate(this.cardPrefab, this.uiCanvas.transform); this.cardsInHand.Add(newCard); newCard.transform.position = CalculateCardPosition(i, numberOfCards); Button button = newCard.GetComponent