Пример #1
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);
	}
Пример #2
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);
        }