1234567891011121314151617181920212223242526 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
-
- public class MoveTEST : MonoBehaviour, IPointerDownHandler, IDragHandler
- {
- [SerializeField] GameObject Main_pic;
-
- private Vector3 offsete;
-
- public void OnPointerDown(PointerEventData eventData)
- {
- offsete = Main_pic.transform.position - Input.mousePosition;
- }
-
- public void OnDrag(PointerEventData eventData)
- {
- Main_pic.transform.position = Input.mousePosition + offsete;
- }
-
-
-
- }
-
-
|