private static void ExportDaeFile(MenuCommand menuCommand) { var objectTarget = menuCommand.context as VoxelSkinnedAnimationObject; if (objectTarget == null) { return; } var objectCore = new VoxelSkinnedAnimationObjectCore(objectTarget); DaeExporterWindow.Open(objectTarget.rigAnimationType == VoxelSkinnedAnimationObject.RigAnimationType.Humanoid, () => { string path = EditorUtility.SaveFilePanel("Export COLLADA(dae) File", objectCore.GetDefaultPath(), string.Format("{0}.dae", Path.GetFileNameWithoutExtension(objectTarget.voxelFilePath)), "dae"); if (string.IsNullOrEmpty(path)) { return; } if (!objectCore.ExportDaeFileWithAnimation(path, DaeExporterWindow.exportMesh, DaeExporterWindow.exportAnimation, DaeExporterWindow.enableFootIK)) { Debug.LogErrorFormat("<color=green>[Voxel Importer]</color> Export COLLADA(dae) File error. file:{0}", path); } }); }
public static void Open(bool human, Action onExport) { DaeExporterWindow.human = human; DaeExporterWindow.onExport = onExport; if (instance == null) { instance = CreateInstance <DaeExporterWindow>(); } instance.titleContent = new GUIContent("Collada Exporter"); instance.minSize = instance.maxSize = new Vector2(180, 80); instance.ShowAuxWindow(); }