Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
 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);
        }
    }
Exemplo n.º 4
0
 public static void Clear()
 {
     OnDrag.Clear();
     OnZoom.Clear();
     _popupMessage?.Clear();
     _fadeMessage?.Clear();
     MainCanvas.DestroyChildren();
 }
Exemplo n.º 5
0
 public void OnScroll(PointerEventData eventData)
 {
     OnZoom?.Invoke(eventData.scrollDelta.y * sensitivity * Time.deltaTime);
 }
Exemplo n.º 6
0
 public void NotifyZoom(Event e) => OnZoom?.Invoke(this, e);
Exemplo n.º 7
0
 public static void BroadcastOnZoom(int scrollValue)
 {
     OnZoom?.Invoke(scrollValue);
 }