Exemplo n.º 1
0
        private static IEnumerator MouseMoveHandler()
        {
            var initalMousePosition = Input.mousePosition;

            yield return(new WaitUntil(() => initalMousePosition != Input.mousePosition));

            GuiManager.FreeMouse();
            if (EventSystem.current.alreadySelecting)
            {
                EventSystem.current.SetSelectedGameObject(null);
            }
        }
Exemplo n.º 2
0
        public void OnShow()
        {
            gameObject.SetActive(true);

            if (PausesGame)
            {
                GameManager.PauseGame();
            }
            else
            {
                GameManager.UnpauseGame();
            }

            if (FreeMouse)
            {
                GuiManager.FreeMouse();
            }
            else
            {
                GuiManager.TrapMouse();
            }
        }
Exemplo n.º 3
0
        public void OnShow()
        {
            gameObject.SetActive(true);

            if (PausesGame)
            {
                GameManager.Instance.PauseGame();
            }
            else
            {
                GameManager.Instance.UnpauseGame();
            }

            if (FreeMouse)
            {
                if (MouseHiddenUntilMove && GuiManager.CanHideMouseUntilMove())
                {
                    if (GuiManager.IsMouseFree())
                    {
                        GuiManager.TrapMouse();
                    }
                    StartCoroutine(MouseMoveHandler());
                    if (DefaultSelectable)
                    {
                        DefaultSelectable.Select();
                    }
                }
                else
                {
                    GuiManager.FreeMouse();
                }
            }
            else
            {
                GuiManager.TrapMouse();
            }
        }