com.wallstop-studios.dxmessaging 2.0.0-rc26.3 → 2.0.0-rc26.4

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.
@@ -143,7 +143,7 @@
143
143
 
144
144
  foreach (TypeToGenerateInfo typeInfo in typesToGenerate)
145
145
  {
146
- if (!processedTypes.Add(typeInfo.TypeSymbol))
146
+ if (!processedTypes.Add(typeInfo.TypeSymbol) || typeInfo.FieldsToInject.Length == 0)
147
147
  {
148
148
  continue; // Already processed this type (e.g., from another partial definition)
149
149
  }
@@ -171,13 +171,14 @@
171
171
  ImmutableArray<IFieldSymbol> fieldsToInject
172
172
  )
173
173
  {
174
+
174
175
  string namespaceName = typeSymbol.ContainingNamespace.IsGlobalNamespace
175
176
  ? string.Empty
176
177
  : typeSymbol.ContainingNamespace.ToDisplayString();
177
178
  string namespaceBlockOpen = string.IsNullOrEmpty(namespaceName)
178
- ? "namespace\n{"
179
+ ? string.Empty
179
180
  : $"namespace {namespaceName}\n{{";
180
- const string namespaceBlockClose = "}";
181
+ string namespaceBlockClose = string.IsNullOrEmpty(namespaceName) ? string.Empty : "}";
181
182
  const string indent = " ";
182
183
 
183
184
  string typeName = typeSymbol.ToDisplayString(
@@ -258,9 +258,9 @@
258
258
  ? string.Empty
259
259
  : typeSymbol.ContainingNamespace.ToDisplayString();
260
260
  string namespaceBlockOpen = string.IsNullOrEmpty(namespaceName)
261
- ? "namespace\n{"
261
+ ? string.Empty
262
262
  : $"namespace {namespaceName}\n{{";
263
- const string namespaceBlockClose = "}";
263
+ string namespaceBlockClose = string.IsNullOrEmpty(namespaceName) ? string.Empty : "}";
264
264
  const string indent = " ";
265
265
 
266
266
  string typeNameWithGenerics = typeSymbol.ToDisplayString(
@@ -279,10 +279,12 @@
279
279
 
280
280
  string accessibility = typeSymbol.DeclaredAccessibility switch
281
281
  {
282
- Accessibility.Public => "public ",
283
- Accessibility.Internal => "internal ",
282
+ Accessibility.Public => "public",
283
+ Accessibility.Protected => "protected",
284
+ Accessibility.Private => "private",
285
+ Accessibility.Internal => "internal",
284
286
  // Add others if necessary, default to internal if restrictive
285
- _ => "internal ",
287
+ _ => "internal",
286
288
  };
287
289
 
288
290
  string interfaceDeclaration = $", global::{targetInterfaceFullName}";
@@ -294,7 +296,7 @@
294
296
 
295
297
  {{namespaceBlockOpen}}
296
298
  {{indent}}// Partial implementation for {{typeNameWithGenerics}} to implement {{BaseInterfaceFullName}}
297
- {{indent}}{{accessibility}}partial {{typeKind}} {{typeNameWithGenerics}} : global::{{BaseInterfaceFullName}} {{interfaceDeclaration}}
299
+ {{indent}}{{accessibility}} partial {{typeKind}} {{typeNameWithGenerics}} : global::{{BaseInterfaceFullName}} {{interfaceDeclaration}}
298
300
  {{indent}}{
299
301
  {{indent}} /// <inheritdoc/>
300
302
  {{indent}} public global::System.Type MessageType => typeof({{fullyQualifiedName}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.wallstop-studios.dxmessaging",
3
- "version": "2.0.0-rc26.3",
3
+ "version": "2.0.0-rc26.4",
4
4
  "displayName": "DxMessaging",
5
5
  "description": "Synchronous Event Bus for Unity",
6
6
  "unity": "2021.3",
@@ -35,3 +35,4 @@
35
35
 
36
36
 
37
37
 
38
+