mmorpg/Assets/Script/Inventory/InventorySlot.cs

25 lines
609 B
C#

using Assets.HeroEditor4D.InventorySystem.Scripts.Elements;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class InventorySlot : MonoBehaviour , IDropHandler
{
public void OnDrop(PointerEventData eventData){
if(transform.childCount == 0){
ItemInventory inventoryItemm = eventData.pointerDrag.GetComponent<ItemInventory>();
inventoryItemm.parentAfterDrag = transform;
}
}
public void Clear()
{
GetComponentInChildren<ItemInventory>().Clear();
}
}