Exemple #1
0
        void Update()
        {
            if (m_InputActive)
            {
                return;
            }

            if (m_HideWindows)
            {
                m_HideWindows = false;
                foreach (var window in UIWindowUtility.GetAllWindowsWithInput())
                {
                    window.Hide();
                }
            }
            else
            {
                if (m_CloseWindowsWhenClickWorld &&
                    Input.GetMouseButtonDown(0) &&
                    UIUtility.isHoveringUIElement == false)
                {
                    m_HideWindows = true;
                }
            }
        }
 protected virtual void HideAllInputWindows()
 {
     foreach (var window in UIWindowUtility.GetAllWindowsWithInput())
     {
         window.Hide();
     }
 }
        public void Start()
        {
            _interactiveWindowsInScene = UIWindowUtility.GetAllWindowsWithInput();

            window.OnShow += OnShowSettingsWindow;
            window.OnHide += OnHideSettingsWindow;
        }
        protected virtual void Start()
        {
            var windows = UIWindowUtility.GetAllWindowsWithInput();

            foreach (var window in windows)
            {
                if (window.isVisible)
                {
                    _windowCounter++;
                }

                window.OnShow += () =>
                {
                    _windowCounter++;

                    if (_windowCounter > 0 && _registered)
                    {
                        SetActive(false);
                    }
                };

                window.OnHide += () =>
                {
                    _windowCounter--;

                    if (_windowCounter == 0 && _registered == false)
                    {
                        SetActive(true);
                    }
                };
            }

            if (_windowCounter > 0)
            {
                SetActive(false);
                //Cursor.visible = true;
            }
        }