/// <summary> /// This function is called when the object becomes enabled and active. /// </summary> void OnEnable() { if (card != null) { card.UnlinkUICard(this); card.LinkUICard(this); } }
public void SetupCardUI(CardUnityBase baseCard) { // Debug.Log($"Setting up ui card for {baseCard.cardName}", baseCard); if (card != null) { card.UnlinkUICard(this); } card = baseCard; if (cardImage == null || cardButton == null || rectTransform == null) { Awake(); } cardImage.sprite = card.sprite; gameObject.name = baseCard.cardName; PositionAmountGroup(); baseCard.LinkUICard(this); }