maxhacker11

ItemSlot.cs

Aug 14th, 2023
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | Source Code | 0 0
  1. using UnityEngine;
  2. using UnityEngine.EventSystems;
  3.  
  4. public class ItemSlot : MonoBehaviour, IDropHandler
  5. {
  6.     public void OnDrop(PointerEventData eventData)
  7.     {
  8.         if(transform.childCount == 0)
  9.         {
  10.             eventData.pointerDrag.GetComponent<DraggableItem>().parentAfterDrag = transform;
  11.         }
  12.     }
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment