Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- public class Slot : MonoBehaviour, IDropHandler {
- //public GameObject item
- //{
- // get
- // {
- // if (transform.childCount > 0)
- // {
- // return transform.GetChild(0).gameObject;
- // }
- // return null;
- // }
- //}
- [SerializeField] GameObject item1;
- public void OnDrop(PointerEventData eventData)
- {
- if (!item1)
- {
- DragHandeler.itemBeingDragged.transform.SetParent(transform);
- }
- }
- // Update is called once per frame
- void Update () {
- if (transform.childCount > 0)
- {
- Transform tempTransform = transform.GetChild(0);
- item1 = tempTransform.gameObject;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement