Exemple #1
0
        public Panel(ScriptableObject ownerObject, ContextType contextType, EventDispatcher dispatcher = null)
        {
            m_VisualTreeUpdater = new VisualTreeUpdater(this);

            this.ownerObject      = ownerObject;
            this.contextType      = contextType;
            this.dispatcher       = dispatcher ?? EventDispatcher.instance;
            repaintData           = new RepaintData();
            cursorManager         = new CursorManager();
            contextualMenuManager = null;
            m_RootContainer       = new VisualElement
            {
                name        = VisualElementUtils.GetUniqueName("unity-panel-container"),
                viewDataKey = "PanelContainer"
            };

            // Required!
            visualTree.SetPanel(this);
            focusController       = new FocusController(new VisualElementFocusRing(visualTree));
            m_ProfileUpdateName   = "PanelUpdate";
            m_ProfileLayoutName   = "PanelLayout";
            m_ProfileBindingsName = "PanelBindings";

            allowPixelCaching = true;
            InvokeHierarchyChanged(visualTree, HierarchyChangeType.Add);
        }
Exemple #2
0
 public Panel(ScriptableObject ownerObject, ContextType contextType, EventDispatcher dispatcher)
 {
     this.< eventInterpreter > k__BackingField = EventInterpreter.s_Instance;
     this.m_ValidatingLayout = false;
     base..ctor();
     this.ownerObject           = ownerObject;
     this.contextType           = contextType;
     this.dispatcher            = dispatcher;
     this.repaintData           = new RepaintData();
     this.cursorManager         = new CursorManager();
     base.contextualMenuManager = null;
     this.m_VisualTreeUpdater   = new VisualTreeUpdater(this);
     this.m_RootContainer       = new VisualElement
     {
         name        = VisualElementUtils.GetUniqueName("unity-panel-container"),
         viewDataKey = "PanelContainer"
     };
     this.visualTree.SetPanel(this);
     this.focusController = new FocusController(new VisualElementFocusRing(this.visualTree, VisualElementFocusRing.DefaultFocusOrder.ChildOrder));
     this.CreateMarkers();
     base.InvokeHierarchyChanged(this.visualTree, HierarchyChangeType.Add);
 }
Exemple #3
0
        public Panel(ScriptableObject ownerObject, ContextType contextType, EventDispatcher dispatcher)
        {
            this.ownerObject      = ownerObject;
            this.contextType      = contextType;
            this.dispatcher       = dispatcher;
            repaintData           = new RepaintData();
            cursorManager         = new CursorManager();
            contextualMenuManager = null;
            m_VisualTreeUpdater   = new VisualTreeUpdater(this);
            m_RootContainer       = new VisualElement
            {
                name        = VisualElementUtils.GetUniqueName("unity-panel-container"),
                viewDataKey = "PanelContainer"
            };

            // Required!
            visualTree.SetPanel(this);
            focusController = new FocusController(new VisualElementFocusRing(visualTree));

            CreateMarkers();

            InvokeHierarchyChanged(visualTree, HierarchyChangeType.Add);
        }