Esempio n. 1
0
        protected void OnEnterPanel()
        {
            var p = panel as BaseVisualElementPanel;

            if (p != null)
            {
                if (graphViewShader == null)
                {
                    graphViewShader = EditorGUIUtility.LoadRequired("GraphView/GraphViewUIE.shader") as Shader;
                }
                p.standardShader = graphViewShader;
                HostView ownerView = p.ownerObject as HostView;
                if (ownerView != null && ownerView.actualView != null)
                {
                    ownerView.actualView.antiAliasing = 4;
                }

                // Changing the updaters is assumed not to be a normal use case, except maybe for Unity debugging
                // purposes. For that reason, we don't track updater changes.
                Panel.BeforeUpdaterChange += OnBeforeUpdaterChange;
                Panel.AfterUpdaterChange  += OnAfterUpdaterChange;
                UpdateDrawChainRegistration(true);
            }

            // Force DefaultCommonDark.uss since GraphView only has a dark style at the moment
            UIElementsEditorUtility.ForceDarkStyleSheet(this);
        }
Esempio n. 2
0
        void OnEnterPanel(AttachToPanelEvent e)
        {
            // Force DefaultCommonDark.uss since GraphView only has a dark style at the moment
            UIElementsEditorUtility.ForceDarkStyleSheet(this);

            if (isReframable)
            {
                panel.visualTree.RegisterCallback <KeyDownEvent>(OnKeyDownShortcut);
            }
        }