Beispiel #1
0
        // Update is called once per frame
        void Update()
        {
            //CLIENT ONLY

            if (!NoInputs && !WindowsActive)
            {
                if (player != null)
                {
                    DetectInput();
                }
                CheckForMouse1ClickEvents();
                if (Input.GetAxis("Mouse ScrollWheel") > 0f) // forward
                {
                    OnScrollEvent?.Invoke(ScrollDirection.DOWN);
                }
                else if (Input.GetAxis("Mouse ScrollWheel") < 0f) // backwards
                {
                    OnScrollEvent?.Invoke(ScrollDirection.UP);
                }
            }

            if (!WindowsActive && Input.GetKeyDown(KeyCode.Tab))
            {
                WindowsActive = true;
                OnInputStateChangeEvent?.Invoke(true);
                //OnWindowVisibilityEvent?.Invoke("all",true);
            }
            if (!WindowsActive && Input.GetKeyDown(KeyCode.I))
            {
                WindowsActive = true;
                OnInputStateChangeEvent?.Invoke(true);
                OnWindowVisibilityEvent?.Invoke("ShipInfoWindow", true);
            }
            if (!ActiveWindow && Input.GetKeyDown(KeyCode.R))
            {
                ActiveWindow = true;

                OnWindowVisibilityEvent?.Invoke("RadarList", true);
            }
            else if (ActiveWindow && Input.GetKeyDown(KeyCode.R))
            {
                ActiveWindow = false;

                OnWindowVisibilityEvent?.Invoke("RadarList", false);
            }

            if (WindowsActive && Input.GetKeyDown(KeyCode.Tab))
            {
                WindowsActive = false;
                OnInputStateChangeEvent?.Invoke(false);
                OnWindowVisibilityEvent?.Invoke("all", false);
            }
        }
Beispiel #2
0
 /// <summary>
 /// On scroll.
 /// </summary>
 /// <param name="eventData">Pointer event data.</param>
 public void OnScroll(PointerEventData eventData)
 {
     OnScrollEvent?.Invoke(eventData);
 }
Beispiel #3
0
 public virtual void OnScrollHandler(ScrollEventArgs e)
 {
     OnScrollEvent?.Invoke(this, e);
 }