UIElementDragger.cs 351 B

123456789101112131415
  1. using UnityEngine;
  2. using UnityEngine.EventSystems;
  3. namespace Agora.Util
  4. {
  5. public class UIElementDrag : EventTrigger
  6. {
  7. public override void OnDrag(PointerEventData eventData)
  8. {
  9. transform.position = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
  10. base.OnDrag(eventData);
  11. }
  12. }
  13. }