コード例 #1
0
 private void OnDestroy()
 {
     RuntimeEditorApplication.ActivateWindow(null);
     RuntimeEditorApplication.PointerExit(this);
     RuntimeEditorApplication.RemoveWindow(this);
     OnDestroyOverride();
 }
コード例 #2
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);
                    }
                }
            }
        }
コード例 #3
0
        protected override void OnDestroyOverride()
        {
            base.OnDestroyOverride();

            RuntimeEditorApplication.ActivateWindow(null);
            RuntimeEditorApplication.PointerExit(this);
            RuntimeEditorApplication.RemoveWindow(this);
        }
コード例 #4
0
 void IPointerExitHandler.OnPointerExit(PointerEventData eventData)
 {
     if (WindowType == RuntimeWindowType.SceneView || WindowType == RuntimeWindowType.GameView)
     {
         return;
     }
     m_isPointerOver = false;
     RuntimeEditorApplication.PointerExit(this);
     OnPointerExitOverride(eventData);
 }
コード例 #5
0
 protected override void OnPointerExitOverride(PointerEventData eventData)
 {
     base.OnPointerExitOverride(eventData);
     if (WindowType == RuntimeWindowType.SceneView || WindowType == RuntimeWindowType.GameView)
     {
         return;
     }
     m_isPointerOver = false;
     RuntimeEditorApplication.PointerExit(this);
 }