using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class LogicCollectable : Collectable { [SerializeField] protected Inventory.Data Collectable; [SerializeField] protected GameObject BlockMenu; [SerializeField] protected TextMeshProUGUI popUpText; public override void OnCollect(Character character) { character.Inventory.Add(Collectable); if (BlockMenu != null) { BlockMenu.SetActive(true); Debug.Log("You picked up the new coding block " + Collectable.element.DisplayName + "!"); popUpText.text = Collectable.element.DisplayName.ToUpper(); } Destroy(gameObject); } }