export-table-pulgin-csharp 1.1.70 → 1.1.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCSPlugin.d.ts","sourceRoot":"","sources":["../src/ExportCSPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAA0B,MAAM,kBAAkB,CAAA;AAM1H,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAgUpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC"}
1
+ {"version":3,"file":"ExportCSPlugin.d.ts","sourceRoot":"","sources":["../src/ExportCSPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAA0B,MAAM,kBAAkB,CAAA;AAM1H,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAsUpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC"}
@@ -242,7 +242,7 @@ ${(0, export_table_lib_1.foreach)(fields, f => {
242
242
  ${(0, export_table_lib_1.foreach)(fields, f => {
243
243
  if (f.isUnique) {
244
244
  let memberName = convMemberName(f.name);
245
- let tempDictByMemberName = `_tempDictBy${memberName}`;
245
+ let tempDictByMemberName = `tempDictBy${memberName}`;
246
246
  let memberType = getFieldType(f);
247
247
  return `
248
248
  protected static Dictionary<${memberType}, ${RowClass}> ${tempDictByMemberName};
@@ -257,16 +257,22 @@ ${(0, export_table_lib_1.foreach)(fields, f => {
257
257
  ${tempDictByMemberName}.Add(c.${memberName}, c);
258
258
  }
259
259
  }
260
+ #if UNITY_EDITOR
261
+ if (${tempDictByMemberName}.Count != Configs.Count)
262
+ {
263
+ Debug.LogError($"配表数据不一致(ConfigsUnmatched): {${tempDictByMemberName}.Count}!={Configs.Count}");
264
+ }
265
+ #endif
260
266
  return ${tempDictByMemberName}.GetValueOrDefault(${memberName});
261
267
  }
262
268
  `;
263
269
  }
264
270
  else if (f.type == "number" || f.type == "int" || f.type == "long" || f.type == "string") {
265
271
  let memberName = convMemberName(f.name);
266
- let tempRecordsDictByMemberName = `_tempRecordsDictBy${memberName}`;
272
+ let tempRecordsDictByMemberName = `tempRecordsDictBy${memberName}`;
267
273
  let memberType = getFieldType(f);
268
274
  return `
269
- protected static Dictionary<${memberType}, ${RowClass}[]> ${tempRecordsDictByMemberName} = new Dictionary<${memberType}, ${RowClass}[]>(Configs.Count);
275
+ protected static Dictionary<${memberType}, ${RowClass}[]> ${tempRecordsDictByMemberName};
270
276
  public static ${RowClass}[] GetConfigsBy${memberName}(${memberType} ${memberName})
271
277
  {
272
278
  if (${tempRecordsDictByMemberName} != null && ${tempRecordsDictByMemberName}.TryGetValue(${memberName},out var retValue))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "export-table-pulgin-csharp",
3
- "version": "1.1.70",
3
+ "version": "1.1.72",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -214,7 +214,7 @@ ${foreach(fields, f => {
214
214
  ${foreach(fields, f => {
215
215
  if (f.isUnique) {
216
216
  let memberName = convMemberName(f.name);
217
- let tempDictByMemberName = `_tempDictBy${memberName}`;
217
+ let tempDictByMemberName = `tempDictBy${memberName}`;
218
218
  let memberType = getFieldType(f);
219
219
  return `
220
220
  protected static Dictionary<${memberType}, ${RowClass}> ${tempDictByMemberName};
@@ -229,15 +229,21 @@ ${foreach(fields, f => {
229
229
  ${tempDictByMemberName}.Add(c.${memberName}, c);
230
230
  }
231
231
  }
232
+ #if UNITY_EDITOR
233
+ if (${tempDictByMemberName}.Count != Configs.Count)
234
+ {
235
+ Debug.LogError($"配表数据不一致(ConfigsUnmatched): {${tempDictByMemberName}.Count}!={Configs.Count}");
236
+ }
237
+ #endif
232
238
  return ${tempDictByMemberName}.GetValueOrDefault(${memberName});
233
239
  }
234
240
  `
235
241
  } else if (f.type == "number" || f.type == "int" || f.type == "long" || f.type == "string") {
236
242
  let memberName = convMemberName(f.name);
237
- let tempRecordsDictByMemberName = `_tempRecordsDictBy${memberName}`;
243
+ let tempRecordsDictByMemberName = `tempRecordsDictBy${memberName}`;
238
244
  let memberType = getFieldType(f);
239
245
  return `
240
- protected static Dictionary<${memberType}, ${RowClass}[]> ${tempRecordsDictByMemberName} = new Dictionary<${memberType}, ${RowClass}[]>(Configs.Count);
246
+ protected static Dictionary<${memberType}, ${RowClass}[]> ${tempRecordsDictByMemberName};
241
247
  public static ${RowClass}[] GetConfigsBy${memberName}(${memberType} ${memberName})
242
248
  {
243
249
  if (${tempRecordsDictByMemberName} != null && ${tempRecordsDictByMemberName}.TryGetValue(${memberName},out var retValue))