Exemplo n.º 1
0
	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 void showExportResultsWindow()
        {
            var tmpLog = new Logger();

            for (int i = 0; i < 100; i++)
            {
                tmpLog.logFormat("Test log {0}", Random.Range(0, 256));
                tmpLog.logWarningFormat("Test warning {0}", Random.Range(0, 256));
                tmpLog.logErrorFormat("Test error {0}", Random.Range(0, 256));
            }
            ExportResultWindow.openWindow(tmpLog);
        }
Exemplo n.º 3
0
	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);
	}
Exemplo n.º 4
0
	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);
	}
Exemplo n.º 5
0
	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);
	}
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        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);
        }