Exemplo n.º 1
0
        public NodeEditorPanel(IGUI _gui,
                               EditorWindow _editorWindow,
                               ConstellationScript _script,
                               IUndoable _undoable,
                               ClipBoard _editorClipBoard,
                               float positionX,
                               float positionY,
                               NodeEditorLinks.LinkAdded linkAdded,
                               NodeEditorLinks.LinkRemoved onLinkRemoved,
                               NodeEditorNodes.NodeAdded nodeAdded,
                               NodeEditorNodes.NodeRemoved nodeRemoved,
                               NodeEditorNodes.HelpClicked onHelpClicked,
                               ApplyInstanceChanges applyInstanceChanges,
                               ConstellationScriptData[] _constellationScripts)
        {
            constellationScripts = _constellationScripts;
            constellationScript  = _script;
            undoable             = _undoable;
            GUI              = _gui;
            EditorWindow     = _editorWindow;
            editorScrollSize = new Vector2(500, 500);
            var backgroundTexture = AssetDatabase.LoadAssetAtPath(editorPath + "background.png", typeof(Texture2D)) as Texture2D;

            Background = new NodeEditorBackground(GUI, backgroundTexture);

            var allNodes = NodesFactory.GetAllNodes();

            nodes           = new string[allNodes.Length];
            editorScrollPos = new Vector2(positionX, positionY);

            for (var i = 0; i < allNodes.Length; i++)
            {
                nodes[i] = allNodes[i];
            }
            OnLinkAdded            += linkAdded;
            OnNodeAdded            += nodeAdded;
            OnNodeRemoved          += nodeRemoved;
            OnApplyInstanceChanges += applyInstanceChanges;
            OnHelpClicked          += onHelpClicked;
            OnLinkRemoved          += onLinkRemoved;
            nodeEditorSelection     = new NodeEditorSelection(GUI, _editorClipBoard);
            RequestSetup();
        }
Exemplo n.º 2
0
        public NodeEditorPanel(IGUI _gui,
                               EditorWindow _editorWindow,
                               ConstellationScript _script,
                               IUndoable _undoable,
                               ClipBoard _editorClipBoard,
                               float positionX,
                               float positionY,
                               LinkAdded linkAdded,
                               LinkRemoved onLinkRemoved,
                               NodeAdded nodeAdded,
                               NodeRemoved nodeRemoved,
                               HelpClicked onHelpClicked,
                               ApplyInstanceChanges applyInstanceChanges)
        {
            isTutorial          = false;
            nodesFactory        = new NodesFactory();
            constellationScript = _script;
            undoable            = _undoable;
            Nodes            = new List <NodeView> ();
            GUI              = _gui;
            EditorWindow     = _editorWindow;
            editorScrollSize = new Vector2(500, 500);
            Background       = AssetDatabase.LoadAssetAtPath(editorPath + "background.png", typeof(Texture2D)) as Texture2D;
            var allNodes = NodesFactory.GetAllNodes();

            nodes           = new string[allNodes.Length];
            editorScrollPos = new Vector2(positionX, positionY);

            for (var i = 0; i < allNodes.Length; i++)
            {
                nodes[i] = allNodes[i];
            }
            OnLinkAdded            += linkAdded;
            OnNodeAdded            += nodeAdded;
            OnNodeRemoved          += nodeRemoved;
            OnApplyInstanceChanges += applyInstanceChanges;
            OnHelpClicked          += onHelpClicked;
            OnLinkRemoved          += onLinkRemoved;
            nodeEditorSelection     = new NodeEditorSelection(GUI, _editorClipBoard);
        }