private void ExportAll() { string path = EditorUtility.SaveFilePanel("请选择要导出的dsl文件", string.Empty, string.Empty, "dsl"); if (!string.IsNullOrEmpty(path)) { if (File.Exists(path)) { File.Delete(path); } foreach (ItemInfo item in m_FbxList) { if (item.Selected) { var importer = AssetImporter.GetAtPath(item.Path) as ModelImporter; if (null != importer) { AnimationClipUtility.Export(path, Path.GetFileNameWithoutExtension(item.Path), importer); Debug.Log("ExportAll " + item.Path); } } } EditorUtility.DisplayDialog("提示", "处理完成", "ok"); } }
private void ImportToSelected() { string path = EditorUtility.OpenFilePanel("请选择要导入的dsl文件", string.Empty, "dsl"); if (!string.IsNullOrEmpty(path) && File.Exists(path)) { var objs = Selection.objects; foreach (var obj in objs) { var itemPath = AssetDatabase.GetAssetPath(obj); var importer = AssetImporter.GetAtPath(itemPath) as ModelImporter; if (null != importer) { AnimationClipUtility.Import(path, Path.GetFileNameWithoutExtension(itemPath), importer); Debug.Log("ImportSelected " + itemPath); } } EditorUtility.DisplayDialog("提示", "处理完成", "ok"); } }