示例#1
0
        /// <summary>
        /// If snapToBottom is enabled, force the scrollbar to the bottom
        /// </summary>
        private void LateUpdate()
        {
            if (screenDimensionsChanged)
            {
                // Update the recycled list view
                if (isLogWindowVisible)
                {
                    recycledListView.OnViewportDimensionsChanged();
                }
                else
                {
                    popupManager.OnViewportDimensionsChanged();
                }

                screenDimensionsChanged = false;
            }

            if (snapToBottom)
            {
                logItemsScrollRect.verticalNormalizedPosition = 0f;

                if (snapToBottomButton.activeSelf)
                {
                    snapToBottomButton.SetActive(false);
                }
            }
            else
            {
                float scrollPos = logItemsScrollRect.verticalNormalizedPosition;
                if (snapToBottomButton.activeSelf != (scrollPos > 1E-6f && scrollPos < 0.9999f))
                {
                    snapToBottomButton.SetActive(!snapToBottomButton.activeSelf);
                }
            }

            // Hide/Show the debugger windows when user presses F5
            if (CommonInput.GetKeyDown(KeyCode.F5))
            {
                if (popupManager.isLogPopupVisible || isLogWindowVisible)
                {
                    Hide();
                    popupManager.Hide();
                }
                else
                {
                    popupManager.ShowWithoutReset();
                }
            }
        }