예제 #1
0
        public BuildScript(string path)
        {
            ScriptPath = Path.GetFullPath(path);

            MaterialGraphs = new ObservableCollection <NodeGraph>();
            XDocument doc = XDocument.Load(path);

            foreach (var graphElem in doc.Element("buildscript").Elements("material"))
            {
                try
                {
                    var graph = NodeGraph.Deserialize(graphElem);

                    if (!Path.IsPathRooted(graph.OutputFileName))
                    {
                        graph.OutputFileName = Path.Combine(ScriptDirectory, graph.OutputFileName);
                    }

                    MaterialGraphs.Add(graph);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }