protected override void OldOnGUI() { // Call reset GUI state as first thing so GUI.color is correct when drawing window decoration. EditorGUIUtility.ResetGUIState(); DoWindowDecorationStart(); using (new GUILayout.VerticalScope(Styles.background)) { if (actualView) { actualView.m_Pos = screenPosition; } try { HandleSplitView(); m_OnGUI?.Invoke(); } finally { CheckNotificationStatus(); DoWindowDecorationEnd(); EditorGUI.ShowRepaints(); } } }
protected override bool OnFocus() { m_OnFocus?.Invoke(); // Callback could have killed us. If so, die now... if (!this) { return(false); } ((IEditorWindowModel)this).focused?.Invoke(); Repaint(); return(true); }
protected void RegisterSelectedPane(bool sendEvents) { if (!m_ActualView) { return; } m_ActualView.m_Parent = this; if (!EditorWindowBackendManager.IsBackendCompatible(windowBackend, this)) { //We create a new compatible backend windowBackend = EditorWindowBackendManager.GetBackend(this); } ((IEditorWindowModel)this).onRegisterWindow?.Invoke(); if (GetPaneMethod("Update") != null) { EditorApplication.update -= SendUpdate; EditorApplication.update += SendUpdate; } if (GetPaneMethod("ModifierKeysChanged") != null) { EditorApplication.modifierKeysChanged -= SendModKeysChanged; EditorApplication.modifierKeysChanged += SendModKeysChanged; } m_ActualView.MakeParentsSettingsMatchMe(); if (m_ActualView.m_FadeoutTime != 0) { EditorApplication.update -= m_ActualView.CheckForWindowRepaint; EditorApplication.update += m_ActualView.CheckForWindowRepaint; } if (sendEvents) { try { m_OnBecameVisible?.Invoke(); m_OnFocus?.Invoke(); } catch (TargetInvocationException ex) { // We need to catch these so the window initialization doesn't get screwed if (ex.InnerException != null) { Debug.LogError(ex.InnerException.GetType().Name + ":" + ex.InnerException.Message); } } } UpdateViewMargins(m_ActualView); }
internal void OnLostFocus() { EditorGUI.EndEditingActiveTextField(); m_OnLostFocus?.Invoke(); // Callback could have killed us if (!this) { return; } ((IEditorWindowModel)this).blurred?.Invoke(); Repaint(); }
void SendModKeysChanged() { m_ModifierKeysChanged?.Invoke(); }
void SendUpdate() { m_Update?.Invoke(); }
internal void OnHierarchyChange() { m_OnHierarchyChange?.Invoke(); }
internal void OnInspectorUpdate() { m_OnInspectorUpdate?.Invoke(); }
internal void OnDidOpenScene() { m_OnDidOpenScene?.Invoke(); }
internal void OnSelectionChange() { m_OnSelectionChange?.Invoke(); }
internal void OnProjectChange() { m_OnProjectChange?.Invoke(); }
internal void OnSelectionChange() { UnityEngine.Profiling.Profiler.BeginSample("HostView.OnSelectionChange." + GetViewName()); m_OnSelectionChange?.Invoke(); UnityEngine.Profiling.Profiler.EndSample(); }