Ejemplo n.º 1
0
        private void Save(string saveName)
        {
            var data = new NodeTreeEditorData
            {
                Name        = _menuBar.NodeTreeName,
                StartNode   = _startNode.Save(_mediaType),
                Nodes       = _nodes.Select(x => x.Save(_mediaType)).ToList(),
                Connections = _connections.Select(x => x.Save(_mediaType)).ToList(),
                Zoom        = _zoom
            };

            File.WriteAllText(Application.dataPath + "/Resources/NodeTrees/" + saveName + ".vn",
                              _mediaType.ConvertTo(data));
            _vnSaver.Save(data, saveName);
        }
 public string Save(IMediaType mediaType) => mediaType.ConvertTo(new StartNodeData {
     ID = ID, X = _rect.x, Y = _rect.y
 });
 public string Save(IMediaType mediaType) => mediaType.ConvertTo(new ConnectionData {
     InNodeID = InPoint.Node.ID, OutNodeID = OutPoint.Node.ID
 });