private string GetNormalJsonStr(Data.TableNode tableNode) { string returnStr; bool isGlobal = code.Data.Setting.getInstance().getSettingClassByType(GlobalData.OUTPUT_TYPE.JSON).globalSetting; List <string> strList = new List <string>(); JsonRowNodeWriter rowNodeWrite = new JsonRowNodeWriter(); returnStr = "{\r\n"; for (int i = 0; i < tableNode.getRowNodeList().Count; i++) { string str = rowNodeWrite.ObjectString(tableNode.getRowNodeList()[i]); if (str == null) { continue; } strList.Add(str); } for (int i = 0; i < strList.Count; i++) { returnStr = returnStr + " " + strList[i] + ((i == strList.Count - 1) ? "" : ","); returnStr = returnStr + "\r\n"; } returnStr = returnStr + GlobalData.getJsonTableBlock() + "}"; return(returnStr); }
//输出values private string GetUnityJsonValuesStr(Data.TableNode tableNode) { JsonRowNodeWriter rowNodeWrite = new JsonRowNodeWriter(); List <string> strList = new List <string>(); string returnStr = " " + "\"values\": [\r\n"; for (int i = 0; i < tableNode.getRowNodeList().Count; i++) { string str = rowNodeWrite.UnityGetValueString(tableNode.getRowNodeList()[i]); if (str == null) { continue; } strList.Add(str); } for (int i = 0; i < strList.Count; i++) { returnStr = returnStr + " " + strList[i] + ((i == strList.Count - 1) ? "" : ","); returnStr = returnStr + "\r\n"; } returnStr = returnStr + " " + "]\r\n"; return(returnStr); }