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.

35 lines
773 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using TMPro;
  6. public class LogicCollectable : Collectable
  7. {
  8. [SerializeField]
  9. protected Inventory.Data Collectable;
  10. [SerializeField]
  11. protected GameObject BlockMenu;
  12. [SerializeField]
  13. protected TextMeshProUGUI popUpText;
  14. public override void OnCollect(Character character)
  15. {
  16. character.Inventory.Add(Collectable);
  17. if (BlockMenu != null)
  18. {
  19. BlockMenu.SetActive(true);
  20. Debug.Log("You picked up the new coding block " + Collectable.element.DisplayName + "!");
  21. popUpText.text = Collectable.element.DisplayName.ToUpper();
  22. }
  23. Destroy(gameObject);
  24. }
  25. }