void beginFullProjectExport(){ var logger = new Logger(); var proj = JsonProject.fromCurrentProject(true, logger); if (proj != null){ proj.saveToFile(targetPath, true, true, logger); } ExportResultWindow.openWindow(logger); }
public static JsonProject fromObjects(GameObject[] obj, bool showGui) { var result = new JsonProject(); var scene = JsonScene.fromObjects(obj, result.resourceMapper, showGui); result.scenes.Add(scene); return(result); }
public static JsonProject fromCurrentProject(bool showGui, Logger logger = null) { Logger.makeValid(ref logger); var result = new JsonProject(); if (!result.collectProjectResources(showGui, logger)) { //logger.logErrorFormat("Project export failed"); return(null); } return(result); }
void beginSelectedObjectsExport(){ var objects = ExportUtility.getSelectedGameObjects(); if (objects.Count <= 0) return; if (!checkTargetPath(targetPath)) return; var logger = new Logger(); var proj = JsonProject.fromObjects(objects.ToArray(), true); proj.saveToFile(targetPath, true, true, logger); ExportResultWindow.openWindow(logger); }
void beginCurrentSceneExport(){ var scene = EditorSceneManager.GetActiveScene(); if (!scene.IsValid()){ Debug.LogWarningFormat("No active scene, cannot export."); } if (!checkTargetPath(targetPath)) return; var logger = new Logger(); var proj = JsonProject.fromScene(scene, true); proj.saveToFile(targetPath, true, true, logger); ExportResultWindow.openWindow(logger); }
void beginSingleObjectExport(){ if (Selection.activeObject == null){ Debug.LogErrorFormat("No active object, cannot proceed with export"); return; } var obj = Selection.activeGameObject; if (!checkTargetPath(targetPath)) return; var logger = new Logger(); var proj = JsonProject.fromObject(obj, true); proj.saveToFile(targetPath, true, true, logger); ExportResultWindow.openWindow(logger); }
public static void exportJsonProj(MenuCommand menuCommand) { var path = EditorUtility.SaveFilePanel("Save category config", "", Application.productName, "json"); if (path == string.Empty) { return; } var logger = new Logger(); var proj = JsonProject.fromCurrentProject(true, logger); Debug.LogFormat("Project: {0}", proj); if (proj != null) { proj.saveToFile(path, true, true, logger); } ExportResultWindow.openWindow(logger); }
public static void exportCurrentObjectProj(MenuCommand menuCommand) { if (Selection.activeObject == null) { return; } var obj = Selection.activeGameObject; var path = EditorUtility.SaveFilePanel("Export current object", "", obj.name, "json"); if (path == string.Empty) { return; } var logger = new Logger(); var proj = JsonProject.fromObject(obj, true); proj.saveToFile(path, true, true, logger); ExportResultWindow.openWindow(logger); }
public static void exportSelectedObjectsProj(MenuCommand menuCommand) { var objects = ExportUtility.getSelectedGameObjects(); if (objects.Count <= 0) { return; } var path = EditorUtility.SaveFilePanel("Export selected objects", "", objects[0].name, "json"); if (path == string.Empty) { return; } var logger = new Logger(); var proj = JsonProject.fromObjects(objects.ToArray(), true); proj.saveToFile(path, true, true, logger); ExportResultWindow.openWindow(logger); }
public static void exportJsonSceneProj(MenuCommand menuCommand) { var scene = EditorSceneManager.GetActiveScene(); if (!scene.IsValid()) { Debug.LogWarningFormat("No active scene, cannot export."); } var path = EditorUtility.SaveFilePanel("Save category config", "", scene.name, "json"); if (path == string.Empty) { return; } var logger = new Logger(); var proj = JsonProject.fromScene(scene, true); proj.saveToFile(path, true, true, logger); ExportResultWindow.openWindow(logger); }