protected override IEnumerable <AssetItem> CreateAssets(AssetTemplateGeneratorParameters parameters) { var files = parameters.Tags.Get(SourceFilesPathKey); if (files == null) { return(base.CreateAssets(parameters)); } var importParameters = new AssetImporterParameters { Logger = parameters.Logger }; importParameters.SelectedOutputTypes.Add(typeof(SkeletonAsset), true); var importedAssets = new List <AssetItem>(); foreach (var file in files) { // TODO: should we allow to select the importer? var importer = AssetRegistry.FindImporterForFile(file).OfType <ModelAssetImporter>().FirstOrDefault(); if (importer == null) { parameters.Logger.Warning($"No importer found for file \"{file}\""); continue; } var assets = importer.Import(file, importParameters).Select(x => new AssetItem(UPath.Combine(parameters.TargetLocation, x.Location), x.Asset)).ToList(); // Create unique names amongst the list of assets importedAssets.AddRange(MakeUniqueNames(assets)); } return(importedAssets); }
protected override IAssetImporter GetImporter() { return(AssetRegistry.FindImporterForFile(Asset.Source).OfType <ModelAssetImporter>().FirstOrDefault()); }
protected override IAssetImporter GetImporter() { return(AssetRegistry.FindImporterForFile(Asset.Source).FirstOrDefault(x => x.RootAssetTypes.Contains(typeof(SpriteStudioModelAsset)))); }
public void CheckImporter() { var importer = AssetRegistry.FindImporterForFile("test.tmp").FirstOrDefault(); Assert.NotNull(importer); }