Beispiel #1
0
        private UIDesciption GenerateUIDescription(string data, FileType type)
        {
            UIDesciption descr = null;

            switch (type)
            {
            case FileType.YAML: {
                YamlSerializer sr   = new YamlSerializer();
                var            docs = sr.Deserialize(data);
                Config = docs[0] as UIGeneratorConfig;
                descr  = docs[1] as UIDesciption;
            } break;
            }

            return(descr);
        }
Beispiel #2
0
        public UIGenerator(string templatesDir)
        {
            string dir = System.IO.Directory.GetCurrentDirectory();

            dir = Path.Combine(dir, templatesDir);

            _fileSystem         = new LocalFileSystem(dir);
            _context            = new Context();
            Template.FileSystem = _fileSystem;
            Template.RegisterFilter(typeof(NamesFormatter));

            s_config = new UIGeneratorConfig()
            {
                PrefabWithPrefix = true
            };

            PrefabsHelper.LoadPrefabs();
        }