string GetProperty(string Cell, IComment comment) { string[] CellValue = ExcelLoaderEditor.GetTypeValue(Cell); if (CellValue.Length < (int)eValueType.MAX) { return(string.Empty); } StringBuilder strBuilder = new StringBuilder(); strBuilder.Append("[SerializeField]"); strBuilder.AppendLine(); strBuilder.Append(string.Format("\tprivate {0} m_{1}", CellValue[(int)eValueType.VALUE_TYPE], CellValue[(int)eValueType.VALUE_NAME])); string TypeValue = CellValue[(int)eValueType.VALUE_TYPE]; if (CellValue[(int)eValueType.VALUE_TYPE].Contains("[]")) { string type = CellValue[(int)eValueType.VALUE_TYPE]; type = type.Replace("[]", "[0]"); strBuilder.Append(string.Format(" = new {0}", type)); TypeValue = TypeValue.Replace("[]", ""); } strBuilder.Append(";"); strBuilder.AppendLine(); if (comment != null) { strBuilder.Append("\t/// <summary>\n"); strBuilder.Append(string.Format("\t///{0}\n", comment.String.String)); strBuilder.Append("\t/// </summary>\n"); } strBuilder.Append(string.Format("\tpublic {0} {1}", CellValue[(int)eValueType.VALUE_TYPE], CellValue[(int)eValueType.VALUE_NAME])); strBuilder.AppendLine(); strBuilder.Append("\t{ get { return " + "m_" + CellValue[(int)eValueType.VALUE_NAME] + "; } set { " + "m_" + CellValue[(int)eValueType.VALUE_NAME] + " = value; } }"); return(strBuilder.ToString()); }
static void OnShow() { ExcelLoaderEditor editor = (ExcelLoaderEditor)EditorWindow.GetWindow(typeof(ExcelLoaderEditor)); editor.Show(); }