Ejemplo n.º 1
0
        public static void FindUserTemplates()
        {
            userTemplates.Clear();
            var configPath = Settings.USERTEMPLATECONFIGPATH;

            if (Directory.Exists(configPath))
            {
                var info     = new DirectoryInfo(configPath);
                var fileInfo = info.GetFiles();
                foreach (var file in fileInfo)
                {
                    if (file.Extension != ".meta")
                    {
                        var entry = new TemplateEntry()
                        {
                            displayName = file.Name,
                            fileName    = Path.GetFileNameWithoutExtension(file.FullName),
                            path        = file.FullName,
                            type        = TEMPLATE_TYPE.UNKNOWN,    // we haven't actually loaded the config at this point, so we don't know what type it is
                        };
                        userTemplates.Add(entry);
                    }
                }
            }
            else
            {
                CreateFolderStructure(configPath, "Assets");
            }
        }
Ejemplo n.º 2
0
        public static void FindDefaultTemplates()
        {
            defaultTemplates.Clear();
            var configPath = Settings.TEMPLATECONFIGPATH;

            if (Directory.Exists(configPath))
            {
                var info     = new DirectoryInfo(configPath);
                var fileInfo = info.GetFiles();
                foreach (var file in fileInfo)
                {
                    if (file.Extension != ".meta")
                    {
                        var entry = new TemplateEntry()
                        {
                            displayName = file.Name,
                            fileName    = Path.GetFileNameWithoutExtension(file.FullName),
                            path        = file.FullName,
                            type        = TEMPLATE_TYPE.UNKNOWN,    // we haven't actually loaded the config at this point, so we don't know what type it is
                        };
                        defaultTemplates.Add(entry);
                    }
                }
            }
            else
            {
                Debug.Log("Package Error: Could not find default template folder?");
            }
        }