Пример #1
0
 protected override void InitializeNodeRenderers(GraphNodeRendererFactory nodeRenderers)
 {
     nodeRenderers.RegisterNodeRenderer(typeof(MarkerNode), new MarkerNodeRenderer());
     nodeRenderers.RegisterNodeRenderer(typeof(GameObjectNode), new MeshNodeRenderer());
     nodeRenderers.RegisterNodeRenderer(typeof(GameObjectArrayNode), new MeshArrayNodeRenderer());
     nodeRenderers.RegisterNodeRenderer(typeof(SpriteNode), new SpriteNodeRenderer());
     nodeRenderers.RegisterNodeRenderer(typeof(MarkerEmitterNode), new MarkerEmitterNodeRenderer());
     nodeRenderers.RegisterNodeRenderer(typeof(CommentNode), new CommentNodeRenderer(EditorStyle.commentTextColor));
 }
 void InitializeNodeRenderers()
 {
     if (nodeRenderers == null)
     {
         nodeRenderers = new GraphNodeRendererFactory();
         nodeRenderers.RegisterNodeRenderer(typeof(MarkerNode), new MarkerNodeRenderer());
         nodeRenderers.RegisterNodeRenderer(typeof(GameObjectNode), new MeshNodeRenderer());
         nodeRenderers.RegisterNodeRenderer(typeof(SpriteNode), new SpriteNodeRenderer());
         nodeRenderers.RegisterNodeRenderer(typeof(MarkerEmitterNode), new MarkerEmitterNodeRenderer());
     }
 }
Пример #3
0
        public void OnEnable()
        {
            hideFlags = HideFlags.HideAndDontSave;
            if (camera == null)
            {
                camera = new GraphCamera();
            }
            if (selectionBox == null)
            {
                selectionBox = new GraphSelectionBox();
                selectionBox.SelectionPerformed += HandleBoxSelection;
            }
            if (keyboardState == null)
            {
                keyboardState = new KeyboardState();
            }
            if (cursorDragLink == null)
            {
                cursorDragLink = new CursorDragLink(this);
                cursorDragLink.DraggedLinkReleased += HandleMouseDraggedLinkReleased;
            }
            if (contextMenu == null)
            {
                contextMenu = CreateContextMenu();
                contextMenu.RequestContextMenuCreation += OnRequestContextMenuCreation;
                contextMenu.MenuItemClicked            += OnMenuItemClicked;
            }

            if (nodeRenderers == null)
            {
                nodeRenderers = new GraphNodeRendererFactory();
                InitializeNodeRenderers(nodeRenderers);
            }

            Undo.undoRedoPerformed += OnUndoRedoPerformed;
        }
Пример #4
0
 protected abstract void InitializeNodeRenderers(GraphNodeRendererFactory nodeRenderers);