Pro_Unit

DragHandler

Apr 10th, 2021 (edited)
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using UniRx;
  2. using UnityEngine;
  3. using UnityEngine.EventSystems;
  4. using UnityEngine.UI;
  5.  
  6. namespace AnimalSimulator.PaintMode.UI.ColorPanel
  7. {
  8.     [RequireComponent(typeof(Image))]
  9.     public class DragHandler : MonoBehaviour, IDragHandler
  10.     {
  11.         public readonly Subject<PointerEventData> OnDrag = new Subject<PointerEventData>();
  12.  
  13.         void IDragHandler.OnDrag(PointerEventData eventData) =>
  14.             OnDrag.OnNext(eventData);
  15.     }
  16. }
Add Comment
Please, Sign In to add comment