// 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); } }
/// <summary> /// On scroll. /// </summary> /// <param name="eventData">Pointer event data.</param> public void OnScroll(PointerEventData eventData) { OnScrollEvent?.Invoke(eventData); }
public virtual void OnScrollHandler(ScrollEventArgs e) { OnScrollEvent?.Invoke(this, e); }