//-------Export Java Class File public void exportClassJava() { string fileName = ""; string classname = "ConV" + root.tag.Replace(" ", ""); #if UNITY_EDITOR fileName = EditorUtility.SaveFilePanel("choose the path you save", Application.dataPath, classname, "java"); #endif if (string.IsNullOrEmpty(fileName)) { return; } classname = fileName.Substring(fileName.LastIndexOf("/") + 1); classname = classname.Replace(".java", ""); string buffer = "public class " + classname + "\r\n{"; for (int i = 0; i < this.paramlist.Count; i++) { List <FixClassCircle.UseParam> detail = this.paramlist[i].Detail; for (int j = 0; j < detail.Count; j++) { buffer += "\r\n\tpublic final String " + detail[j].NameEng.Replace(" ", "_").ToUpper() + "_" + i + " = \"" + detail[j].NameEng + "\";"; } } buffer += "\r\n}"; FixClassCircle.Save(fileName, buffer); }
public void Export(string filePath) { string result = ExportString(); FixClassCircle.Save(filePath, result); }