void Update()
    {
        if (Input.GetButtonUp("Scoreboard"))
        {
            uiManager.ClosePlayerList();
        }

        if (!uiManager.IsUIReceivingInput)
        {
            //meta-game input
            if (Input.GetButtonDown("Scoreboard"))
            {
                uiManager.OpenPlayerList();
            }
            else if (clientGameManager.IsAcceptingGameInput)
            {
                SelectedEntities.RemoveAll(x => x == null);

                //cancel should override all other inputs
                if (Input.GetButtonDown("Cancel"))
                {
                    DoCancel();
                }
                else
                {
                    if (!EventSystem.current.IsPointerOverGameObject())                       //if not over UI element
                    {
                        if (currentTargetingObject != null)
                        {
                            HandleMouseTargetingInput();
                        }
                        else
                        {
                            HandleMouseInput();
                        }
                    }

                    HandleMiscInputs();

                    if (SelectedEntities.Count > 0)
                    {
                        HandleSelectionBasedInputs();
                    }
                }

                if (SelectedEntities.Count == 0 || !SelectedEntities[0].Equals(LastFocusedEntity))
                {
                    LastFocusedEntity = null;
                    rtsCamera.ClearFollowTarget();
                }
            }
        }
    }