private void Update() { OnHovered?.Invoke(Input.mousePosition); if (Input.GetMouseButtonDown(0)) { OnLeftClic?.Invoke(Input.mousePosition); } if (Input.GetMouseButtonDown(1)) { OnRightClic?.Invoke(Input.mousePosition); } float horizontalValue = Input.GetAxisRaw("Horizontal"); OnHorizontalMove?.Invoke(horizontalValue); float verticalValue = Input.GetAxisRaw("Vertical"); OnVerticalMove?.Invoke(verticalValue); float zoomValue = Input.GetAxisRaw("Mouse ScrollWheel"); OnZoom?.Invoke(zoomValue); }
private static void ZoomValue(float v_) { ProcessZoom?.Invoke(MainCamera, CameraSystem, v_); Zoom = v_; OnZoom.Invoke(v_); ViewportLimit?.OnZoom(v_); }
void Update() { Vector3 mp = Input.mousePosition; if (Input.GetMouseButtonDown(1)) { mousePositionOnRotateStart = mp.x; } else if (Input.GetMouseButton(1)) { if (mp.x < mousePositionOnRotateStart) { OnRotate?.Invoke(-1); } else if (mp.x > mousePositionOnRotateStart) { OnRotate?.Invoke(1); } } if (Input.mouseScrollDelta.y > 0 && !EventSystem.current.IsPointerOverGameObject()) { OnZoom?.Invoke(-3f); } else if (Input.mouseScrollDelta.y < 0 && !EventSystem.current.IsPointerOverGameObject()) { OnZoom?.Invoke(3f); } }
public static void Clear() { OnDrag.Clear(); OnZoom.Clear(); _popupMessage?.Clear(); _fadeMessage?.Clear(); MainCanvas.DestroyChildren(); }
public void OnScroll(PointerEventData eventData) { OnZoom?.Invoke(eventData.scrollDelta.y * sensitivity * Time.deltaTime); }
public void NotifyZoom(Event e) => OnZoom?.Invoke(this, e);
public static void BroadcastOnZoom(int scrollValue) { OnZoom?.Invoke(scrollValue); }