Beispiel #1
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (onClick != null)
     {
         onClick.Invoke(eventData);
     }
 }
        public void OnPointerClick()
        {
            RaycastHit hit;

            if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit))
            {
                pointClick = new Vector3(hit.point.x, transform.position.y, hit.point.z);

                OnPointerClickEvent?.Invoke(pointClick);
                isFindTarget = true;
            }
        }
 void IPointerClickHandler.OnPointerClick(PointerEventData eventData)
 {
     OnPointerClickEvent?.Invoke(eventData);
 }
Beispiel #4
0
 /// <summary>
 /// Clicked on an ItemSlot.
 /// </summary>
 /// <param name="eventData"></param>
 public void OnPointerClick(BaseEventData eventData)
 {
     // Invoking this event for all listeners only if they exist.
     // The ? checks if the event is null or not.
     OnPointerClickEvent?.Invoke(this);
 }
Beispiel #5
0
 public virtual void OnPointerClick(PointerEventData eventData)
 {
     OnPointerClickEvent?.Invoke(eventData);
 }
Beispiel #6
0
    // Image _image;
    // Color _defaultColor;
    // Color _glowColor = new Color32(255,255,255,1);

    // void Awake()
    // {
    //     _image = gameObject.GetComponentInParent<Image>();
    //     _defaultColor = _image.color;
    // }

    public void OnPointerClick(PointerEventData eventData) => OnPointerClickEvent?.Invoke();
 public void OnPointerClick(PointerEventData eventData)
 {
     onPointerClickEvent.Invoke(eventData);
 }