Пример #1
0
        private void UpdateState(Rect cameraRect, bool isGameView)
        {
            bool isPointerOver = cameraRect.Contains(Input.mousePosition) && !RuntimeTools.IsPointerOverGameObject();

            if (RuntimeEditorApplication.IsPointerOverWindow(this))
            {
                if (!isPointerOver)
                {
                    RuntimeEditorApplication.PointerExit(this);
                }
            }
            else
            {
                if (isPointerOver)
                {
                    RuntimeEditorApplication.PointerEnter(this);
                }
            }

            if (isPointerOver)
            {
                if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2) ||
                    Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2))
                {
                    if (!isGameView || isGameView && RuntimeEditorApplication.IsPlaying)
                    {
                        RuntimeEditorApplication.ActivateWindow(this);
                    }
                }
            }
        }
        public static void Reset()
        {
            m_windows           = new List <RuntimeEditorWindow>();
            m_pointerOverWindow = null;
            m_activeWindow      = null;
            m_activeCameraIndex = 0;
            GameCameras         = null;
            SceneCameras        = null;
            m_isOpened          = false;
            m_isPlaying         = false;

            EditorSelection.objects = null;
            EditorUndo.Reset();
            RuntimeTools.Reset();
        }