Ejemplo n.º 1
0
 private void OnEnable()
 {
     ShipControll.OnShipWarpEvent += PlayerWarping;
     WindowsActive = false;
     OnInputStateChangeEvent?.Invoke(false);
     OnWindowVisibilityEvent?.Invoke("all", false);
 }
Ejemplo n.º 2
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);
            }
        }