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 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. foreach (LogicBlock block in element.logicElement.GetAllBlocks())
  12. {
  13. BagItem item = InventoryUI.content.FirstOrDefault(p => p.canHold(block));
  14. if (item != default)
  15. item.OnAdd(element);
  16. Destroy(element.gameObject);
  17. }
  18. }
  19. public override void OnDoubleClick(LogicElementUI element)
  20. {
  21. //DoNothing
  22. }
  23. public override void OnRemove(LogicElementUI element)
  24. {
  25. //DoNothing
  26. }
  27. }