Exemplo n.º 1
0
        public NodeWindow(string _editorPath, ConstellationEditorDataService _constellationEditorData, Vector2 windowSize, Vector2 scrollPosition)
        {
            constellationRules = new ConstellationEditorRules();
            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, constellationRules);
            NodeFactory         = new NodesFactory(ConstellationScript.ScriptAssembly.GetAllStaticScriptData());

            foreach (var node in ConstellationScript.GetNodes())
            {
                DisplayNode(node);
            }
        }
Exemplo n.º 2
0
 public LinksView(ConstellationScript _constellationScript, ConstellationEditorRules _constellationRules)
 {
     constellationScript = _constellationScript;
     constellationRules  = _constellationRules;
 }