public void OnPointerClick(PointerEventData eventData) { if (eventData != null && eventData.button == PointerEventData.InputButton.Left) { OnLeftClickEvent?.Invoke(this); } }
public void OnClick(InputAction.CallbackContext context) { if (context.phase != InputActionPhase.Performed) { return; } _isPressed = !_isPressed; OnLeftClickEvent?.Invoke(_isPressed); Log("OnClick"); }
public void OnPointerClick(PointerEventData eventData) { if (eventData.dragging) { return; } switch (eventData.button) { case PointerEventData.InputButton.Left: OnLeftClickEvent?.Invoke(eventData.pointerCurrentRaycast.gameObject.name); break; } }
protected virtual void Update() { if (this == null) { return; } if (MouseOver) { OnMouseOver(); if (Input.GetMouseButtonDown(0)) { LeftClick.Invoke(this); } if (Input.GetMouseButtonDown(1)) { RightClick.Invoke(this); } } DragKey = UI_Manager.Instance.InputKeyModifier(DragKeyModifier); }