using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class DND : MonoBehaviour, IBeginDragHandler, IDragHandler
{
public Transform transform;
public Vector2 vector2;
private void Awake()
{
transform = GetComponent<Transform>();
}
public void OnBeginDrag(PointerEventData eventData)
{
Debug.Log("OnBeginDrag");
}
public void OnDrag(PointerEventData eventData)
{
Debug.Log("OnDrag");
vector2 += eventData.delta;
transform.position = new Vector3(vector2.x, vector2.y, 0);
}
Не работает