private void Update() { if (Input.GetMouseButtonDown(0)) { _isPressed = true; } if (_isPressed && Input.GetMouseButtonUp(0)) { Clicked.Invoke(Camera.main.ScreenToWorldPoint(Input.mousePosition)); _isPressed = false; } }
public void OnPointerUp(PointerEventData eventData) { if (isClicked) { return; } ChangeCellState(false); isClicked = true; eventData.selectedObject = gameObject; ClickedEvent.Invoke(); }
void OnMouseUp() { if (!Active) { return; } if (!string.IsNullOrEmpty(TooltipText)) { ToolTip.Instance.HideTooltip(); } if (BuildingPrefab != null) { ClickedEvent?.Invoke(BuildingPrefab); } }
public void OnPointerClick(PointerEventData data) { if (data.button != PointerEventData.InputButton.Left) { return; } Vector3 worldPoint; if (!Camera.main.ScreenPointToWorldPointInRectangle(transform.position, transform.rotation, data.position, out worldPoint)) { return; } Debug.Log("Click!"); m_OnClick.Invoke(worldPoint); }
void Update() { if (!Camera.main) { return; } _distance += Input.mouseScrollDelta.y * _scrollScale; _distance = Mathf.Clamp(_distance, Camera.main.nearClipPlane, Camera.main.farClipPlane); var ray = Camera.main.ScreenPointToRay(Input.mousePosition, Camera.MonoOrStereoscopicEye.Mono); var p = ray.GetPoint(_distance); transform.position = p; if (Input.GetMouseButtonDown(0) && _onClick != null) { _onClick.Invoke(p); } }
private protected override void OnTouchesEndedUI(List <CCTouch> touches, CCEvent touchEvent) { touchEvent.StopPropogation(); if (touches.Count > 0) { // turn back to original color when released StartSprite.Color = CCColor3B.White; MiddleSprite.Color = CCColor3B.White; EndSprite.Color = CCColor3B.White; label.Color = CCColor3B.White; label2.Color = CCColor3B.White; var touch = touches[0]; if (TouchIsOnIt(touch)) { // move the popUp out of view and remove it RemovePerAction(); Pressable = false; ClickedEvent?.Invoke(this, EventArgs.Empty); } } }
public override void Update(GameTime gameTime) { MouseState mouseState = Mouse.GetState(); if (mouseState.LeftButton == ButtonState.Pressed) { if (buttonArea.Contains(mouseState.Position)) { current = pressedTextureRegion; } } else { if (prevState.LeftButton == ButtonState.Pressed && buttonArea.Contains(mouseState.Position)) { ClickedEvent?.Invoke(); } current = normalTextureRegion; } prevState = mouseState; }
protected void EmitClickEvent() { ClickedEvent?.Invoke(this); }
public override bool PerformClick() { ClickedEvent?.Invoke(); return(base.PerformClick()); }
public void OnTap() { ClickedEvent?.Invoke(this); }
public void OnTap() { ClickedEvent?.Invoke(this, ConstructDataList); }
private void CampClicked(object sender, MouseButtonEventArgs e) { ClickedEvent cl = Clicked; cl?.Invoke(UserID, CampID); }
public void Button_OnClick() => Clicked.Invoke(this, Panel);
private void Wire_Clicked(Wire wire) => Clicked.Invoke(wire);
public void handleClick() { clickedEvent.Invoke(this); }
public void OnClicked() { ClickedEvent?.Invoke(this, new PageTabEventArgs { PageNumber = m_PageNumber }); }