private void ImportAssetsOrError(DefaultAsset[] assets, ImportAnimatorController importAnimatorController = ImportAnimatorController.None) { if (AnimationImporter.IsConfiguredForAssets(assets)) { importer.ImportAssets(assets, importAnimatorController); } else { ShowPopupForBadAsepritePath(assets[0].name); } }
public void ImportAsset(string assetPath, ImportAnimatorController importAnimatorController = ImportAnimatorController.None) { if (!IsValidAsset(assetPath)) { Debug.Log(assetPath); return; } AnimationImportJob job = CreateAnimationImportJob(assetPath); job.importAnimatorController = importAnimatorController; Import(job); }
private void ImportAssetsOrError(DefaultAsset[] assets, ImportAnimatorController importAnimatorController = ImportAnimatorController.None) { if (AnimationImporter.IsConfiguredForAssets(assets)) { try { importer.ImportAssets(assets, importAnimatorController); } catch (System.Exception e) { EditorUtility.ClearProgressBar(); EditorUtility.DisplayDialog("Error", "Unhandled Exception:\n" + e.Message, "Ok"); } } else { ShowPopupForBadAsepritePath(assets[0].name); } }
// ================================================================================ // import methods // -------------------------------------------------------------------------------- public void ImportAssets(DefaultAsset[] assets, ImportAnimatorController importAnimatorController = ImportAnimatorController.None) { List <AnimationImportJob> jobs = new List <AnimationImportJob>(); foreach (var asset in assets) { string assetPath = AssetDatabase.GetAssetPath(asset); if (!IsValidAsset(assetPath)) { continue; } AnimationImportJob job = CreateAnimationImportJob(assetPath); job.importAnimatorController = importAnimatorController; jobs.Add(job); } Import(jobs.ToArray()); }
// ================================================================================ // import methods // -------------------------------------------------------------------------------- public void ImportAssets(DefaultAsset[] assets, ImportAnimatorController importAnimatorController = ImportAnimatorController.None) { List <AnimationImportJob> jobs = new List <AnimationImportJob>(); foreach (var asset in assets) { string assetPath = AssetDatabase.GetAssetPath(asset); if (!IsValidAsset(assetPath)) { continue; } // DDobyns change to support adding to existing Animator Override Controller on manual import AnimationImportJob job = CreateAnimationImportJob(assetPath); if (job != null) { if (HasExistingAnimatorController(assetPath)) { job.importAnimatorController = ImportAnimatorController.AnimatorController; } else if (HasExistingAnimatorOverrideController(assetPath)) { job.importAnimatorController = ImportAnimatorController.AnimatorOverrideController; job.useExistingAnimatorController = true; } jobs.Add(job); } // AnimationImportJob job = CreateAnimationImportJob(assetPath); //job.importAnimatorController = importAnimatorController; // //job.useExistingAnimatorController = true; /// DDobyns test for adding to existing //jobs.Add(job); } Import(jobs.ToArray()); }