private void OnDestroy() { RuntimeEditorApplication.ActivateWindow(null); RuntimeEditorApplication.PointerExit(this); RuntimeEditorApplication.RemoveWindow(this); OnDestroyOverride(); }
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); } } } }
protected override void OnDestroyOverride() { base.OnDestroyOverride(); RuntimeEditorApplication.ActivateWindow(null); RuntimeEditorApplication.PointerExit(this); RuntimeEditorApplication.RemoveWindow(this); }
void IPointerExitHandler.OnPointerExit(PointerEventData eventData) { if (WindowType == RuntimeWindowType.SceneView || WindowType == RuntimeWindowType.GameView) { return; } m_isPointerOver = false; RuntimeEditorApplication.PointerExit(this); OnPointerExitOverride(eventData); }
protected override void OnPointerExitOverride(PointerEventData eventData) { base.OnPointerExitOverride(eventData); if (WindowType == RuntimeWindowType.SceneView || WindowType == RuntimeWindowType.GameView) { return; } m_isPointerOver = false; RuntimeEditorApplication.PointerExit(this); }