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.

30 lines
653 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEngine;
  5. public class InventoryCatch : LogicElementHolder
  6. {
  7. [SerializeField]
  8. private InventoryUI InventoryUI;
  9. public override void OnAdd(LogicElementUI element)
  10. {
  11. BagItem item = InventoryUI.content.FirstOrDefault(p => p.canHold(element));
  12. if (item != default)
  13. item.OnAdd(element);
  14. Destroy(element.gameObject);
  15. }
  16. public override void OnDoubleClick(LogicElementUI element)
  17. {
  18. //DoNothing
  19. }
  20. public override void OnRemove(LogicElementUI element)
  21. {
  22. //DoNothing
  23. }
  24. }