1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using System;
- using UnityEngine.UI;
- namespace MetaClient
- {
- public class ColorPickClick : MonoBehaviour, IPointerDownHandler, IDragHandler
- {
- // Start is called before the first frame update
- void Start()
- {
- }
- public Button.ButtonClickedEvent Click;
- public Vector3 ClickPoint { get; set; }
- public void OnPointerDown(PointerEventData eventData)
- {
- var rect = transform as RectTransform;
- ClickPoint = rect.InverseTransformPoint(eventData.position);
- Click.Invoke();
- }
- public void OnDrag(PointerEventData eventData)
- {
- var rect = transform as RectTransform;
- ClickPoint = rect.InverseTransformPoint(eventData.position);
- Click.Invoke();
- }
- // Update is called once per frame
- void Update()
- {
- }
- }
- }
|