Esempio n. 1
0
        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();
                }
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        internal void OnLostFocus()
        {
            EditorGUI.EndEditingActiveTextField();
            m_OnLostFocus?.Invoke();

            // Callback could have killed us
            if (!this)
            {
                return;
            }

            ((IEditorWindowModel)this).blurred?.Invoke();

            Repaint();
        }
Esempio n. 5
0
 void SendModKeysChanged()
 {
     m_ModifierKeysChanged?.Invoke();
 }
Esempio n. 6
0
 void SendUpdate()
 {
     m_Update?.Invoke();
 }
Esempio n. 7
0
 internal void OnHierarchyChange()
 {
     m_OnHierarchyChange?.Invoke();
 }
Esempio n. 8
0
 internal void OnInspectorUpdate()
 {
     m_OnInspectorUpdate?.Invoke();
 }
Esempio n. 9
0
 internal void OnDidOpenScene()
 {
     m_OnDidOpenScene?.Invoke();
 }
Esempio n. 10
0
 internal void OnSelectionChange()
 {
     m_OnSelectionChange?.Invoke();
 }
Esempio n. 11
0
 internal void OnProjectChange()
 {
     m_OnProjectChange?.Invoke();
 }
Esempio n. 12
0
 internal void OnSelectionChange()
 {
     UnityEngine.Profiling.Profiler.BeginSample("HostView.OnSelectionChange." + GetViewName());
     m_OnSelectionChange?.Invoke();
     UnityEngine.Profiling.Profiler.EndSample();
 }