22 lines
544 B
C#
22 lines
544 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class PointFollow : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
|
{
|
|
public Vector3 StarTransform;
|
|
public void OnBeginDrag(PointerEventData eventData)
|
|
{
|
|
StarTransform = transform.position;
|
|
Debug.Log(1111111);
|
|
}
|
|
|
|
public void OnDrag(PointerEventData eventData)
|
|
{
|
|
transform.position = eventData.position;
|
|
}
|
|
|
|
public void OnEndDrag(PointerEventData eventData)
|
|
{
|
|
transform.position = StarTransform;
|
|
}
|
|
} |