You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
572 B

  1. using UnityEngine;
  2. using TMPro;
  3. public class LogicCollectable : Collectable
  4. {
  5. [SerializeField]
  6. protected Inventory.Data Collectable;
  7. [SerializeField]
  8. protected GameObject BlockMenu;
  9. [SerializeField]
  10. protected TextMeshProUGUI popUpText;
  11. public override void OnCollect(Character character)
  12. {
  13. character.Inventory.Add(Collectable);
  14. if (BlockMenu != null)
  15. {
  16. BlockMenu.SetActive(true);
  17. popUpText.text = Collectable.element.DisplayName.ToUpper();
  18. }
  19. Destroy(gameObject);
  20. }
  21. }