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.

34 lines
752 B

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