Example #1
0
        public NodeWindow(string _editorPath, ConstellationScript _constellationScript)
        {
            var backgroundTexture = AssetDatabase.LoadAssetAtPath(editorPath + "background.png", typeof(Texture2D)) as Texture2D;

            background          = new NodeEditorBackground(backgroundTexture);
            editorPath          = _editorPath;
            SelectedNodes       = new List <NodeView>();
            Nodes               = new List <NodeView>();
            ConstellationScript = _constellationScript;
            Links               = new LinksView(ConstellationScript);
            NodeFactory         = new NodesFactory(ConstellationScript?.ScriptAssembly?.GetAllScriptData());

            foreach (var node in _constellationScript.GetNodes())
            {
                DisplayNode(node);
            }
        }
Example #2
0
        public NodeWindow(string _editorPath, ConstellationEditorDataService _constellationEditorData, Vector2 windowSize, Vector2 scrollPosition)
        {
            farNodeX         = windowSize.x;
            farNodeY         = windowSize.y;
            editorScrollSize = new Vector2(farNodeX + 400, farNodeY + 400);
            ScrollPosition   = scrollPosition;
            var backgroundTexture = AssetDatabase.LoadAssetAtPath(editorPath + "background.png", typeof(Texture2D)) as Texture2D;

            background          = new NodeEditorBackground(backgroundTexture);
            editorPath          = _editorPath;
            SelectedNodes       = new List <NodeView>();
            Nodes               = new List <NodeView>();
            EditorData          = _constellationEditorData;
            ConstellationScript = EditorData.Script;
            Links               = new LinksView(ConstellationScript);
            NodeFactory         = new NodesFactory(ConstellationScript.ScriptAssembly.GetAllStaticScriptData());

            foreach (var node in ConstellationScript.GetNodes())
            {
                DisplayNode(node);
            }
        }