using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; using System; public class WishCard : MonoBehaviour { public GameObject CardFront; public Button CardReturnButton; public Button CardQuestionButton; public TMP_Text CardFrontText; public SpriteRenderer CardBackSprite; public SpriteRenderer CardFrontSprite; public List CollidingEmptySlotCards = new List(); public WishCard SlotInCard; public WishCard SlotOfCard; [SerializeField] private bool m_isSlot = false; public bool isSlot { get { return m_isSlot; } set { m_isSlot = value; //GetComponent().enabled = !m_isSlot; } } public string name; public string description; public string main_representation; public string advice; // Start is called before the first frame update void Start() { //GetComponent().enabled = !isSlot; } private void OnTriggerEnter2D(Collider2D collision) { WishCard card = collision.GetComponent(); if (card != null && card.isSlot && card.SlotOfCard == null) { CollidingEmptySlotCards.Add(card); } } private void OnTriggerExit2D(Collider2D collision) { WishCard card = collision.GetComponent(); if (card != null && card.isSlot) { CollidingEmptySlotCards.Remove(card); } } }