Example #1
0
 static void LoadSetting()
 {
     if (!File.Exists(Setting_Path))
     {
         EditUtils.CreateAsset <ExcelExporterSetting>(Setting_Path);
     }
     setting = AssetDatabase.LoadAssetAtPath <ExcelExporterSetting>(Setting_Path);
 }
Example #2
0
 private static void Output(StringBuilder sb, string path)
 {
     Debug.Log(sb.ToString());
     if (!Directory.Exists(setting.outputPath))
     {
         Directory.CreateDirectory(setting.outputPath);
     }
     EditUtils.SaveUTF8TextFile($"{setting.outputPath}/{Path.GetFileNameWithoutExtension(path)}.lua", sb.ToString());
 }
Example #3
0
        public static ExcelExporterSetting LoadSetting()
        {
            if (!File.Exists(Setting_Path))
            {
                EditUtils.CreateAsset <ExcelExporterSetting>(Setting_Path);
            }
            ExcelExporterSetting setting = AssetDatabase.LoadAssetAtPath <ExcelExporterSetting>(Setting_Path);

            return(setting);
        }
Example #4
0
 private static void ExecuteFile(int rowIndex, List <string> list, StringBuilder sb)
 {
     if (rowIndex == 0)
     {
         headFields = list;
     }
     else if (rowIndex == 1)
     {
         headTypes = list;
     }
     else if (rowIndex == 2)
     {
         //headNames = list;
     }
     else
     {
         sb.Append($"    \"{list[0]}\"");
         sb.Append(": {");
         for (int i = 0; i < list.Count; i++)
         {
             if (headTypes[i] == Type_Number)
             {
                 if (EditUtils.IsNumberic(list[i]))
                 {
                     sb.Append($"\"{headFields[i]}\": {list[i]}");
                 }
                 else
                 {
                     sb.Append($"\"{headFields[i]}\": 0");
                 }
             }
             else
             {
                 sb.Append($"\"{headFields[i]}\": \"{list[i]}\"");
             }
             if (i < list.Count - 1)
             {
                 sb.Append(", ");
             }
         }
         sb.Append("},");
         sb.AppendLine();
     }
 }