Example #1
0
    void load_layouts()
    {
        m_layouts = new NodeLayoutCollection();

        string data_folder = Application.dataPath;
        string folder      = data_folder + "/Layouts/";

        foreach (string file in Directory.GetFiles(folder))
        {
            if (file.Contains(".meta"))
            {
                continue;
            }

            string contents   = File.ReadAllText(file);
            var    serializer = new XmlSerializer(typeof(NodeLayoutCollection));
            NodeLayoutCollection result;

            using (TextReader reader = new StringReader(contents))
            {
                result = (NodeLayoutCollection)serializer.Deserialize(reader);
            }

            m_layouts.Add(result);
        }
    }
Example #2
0
 public void Add(NodeLayoutCollection c)
 {
     Layouts.AddRange(c.Layouts);
 }