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.
 
 
 
 
 
 

31 lines
709 B

using System.Linq;
using UnityEngine;
public class InventoryCatch : LogicElementHolder
{
[SerializeField]
private InventoryUI InventoryUI;
public override void OnAdd(LogicElementUI element)
{
foreach (LogicBlock block in element.logicElement.GetAllBlocks())
{
BagItem item = InventoryUI.content.FirstOrDefault(p => p.canHold(block));
if (item != default)
item.OnAdd(element);
Destroy(element.gameObject);
}
}
public override void OnDoubleClick(LogicElementUI element)
{
//DoNothing
}
public override void OnRemove(LogicElementUI element)
{
//DoNothing
}
}