com.wallstop-studios.dxmessaging 2.1.5 → 2.1.6
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.
- package/.artifacts/SourceGenerators.Tests/obj/Debug/net9.0/WallstopStudios.DxMessaging.SourceGenerators.Tests.AssemblyInfo.cs +1 -1
- package/.cspell.json +4 -1
- package/.github/workflows/actionlint.yml +11 -1
- package/.github/workflows/csharpier-autofix.yml +34 -3
- package/.github/workflows/dotnet-tests.yml +13 -0
- package/.github/workflows/format-on-demand.yml +38 -44
- package/.github/workflows/json-format-check.yml +24 -0
- package/.github/workflows/lint-doc-links.yml +13 -0
- package/.github/workflows/markdown-json.yml +21 -4
- package/.github/workflows/markdown-link-text-check.yml +10 -0
- package/.github/workflows/markdown-link-validity.yml +10 -0
- package/.github/workflows/markdownlint.yml +7 -5
- package/.github/workflows/prettier-autofix.yml +67 -11
- package/.github/workflows/release-drafter.yml +2 -2
- package/.github/workflows/sync-wiki.yml +3 -3
- package/.github/workflows/yaml-format-lint.yml +26 -0
- package/.llm/context.md +113 -3
- package/.llm/skills/documentation/changelog-management.md +38 -0
- package/.llm/skills/documentation/documentation-style-guide.md +18 -0
- package/.llm/skills/documentation/documentation-update-workflow.md +2 -0
- package/.llm/skills/documentation/documentation-updates.md +2 -0
- package/.llm/skills/documentation/markdown-compatibility.md +476 -0
- package/.llm/skills/documentation/mermaid-theming.md +326 -0
- package/.llm/skills/documentation/mkdocs-navigation.md +290 -0
- package/.llm/skills/github-actions/git-renormalize-patterns.md +231 -0
- package/.llm/skills/github-actions/workflow-consistency.md +346 -0
- package/.llm/skills/index.md +53 -27
- package/.llm/skills/scripting/javascript-code-quality.md +417 -0
- package/.llm/skills/scripting/regex-documentation.md +461 -0
- package/.llm/skills/scripting/shell-best-practices.md +55 -4
- package/.llm/skills/scripting/validation-patterns.md +418 -0
- package/.llm/skills/specification.md +4 -1
- package/.llm/skills/testing/test-code-quality.md +243 -0
- package/.llm/skills/testing/test-production-code.md +348 -0
- package/CHANGELOG.md +11 -0
- package/README.md +0 -11
- package/Tests/Runtime/Benchmarks/WallstopStudios.DxMessaging.Tests.Runtime.Benchmarks.asmdef +1 -6
- package/Tests/Runtime/Integrations/Reflex/WallstopStudios.DxMessaging.Tests.Runtime.Reflex.asmdef +1 -1
- package/Tests/Runtime/Integrations/VContainer/WallstopStudios.DxMessaging.Tests.Runtime.VContainer.asmdef +1 -1
- package/Tests/Runtime/Integrations/Zenject/WallstopStudios.DxMessaging.Tests.Runtime.Zenject.asmdef +1 -1
- package/coverage/clover.xml +216 -3
- package/coverage/clover.xml.meta +7 -7
- package/coverage/coverage-final.json +2 -1
- package/coverage/coverage-final.json.meta +7 -7
- package/coverage/lcov-report/base.css.meta +1 -1
- package/coverage/lcov-report/block-navigation.js.meta +1 -1
- package/coverage/lcov-report/favicon.png.meta +1 -1
- package/coverage/lcov-report/index.html +25 -10
- package/coverage/lcov-report/index.html.meta +7 -7
- package/coverage/lcov-report/prettify.css.meta +1 -1
- package/coverage/lcov-report/prettify.js.meta +1 -1
- package/coverage/lcov-report/sort-arrow-sprite.png.meta +1 -1
- package/coverage/lcov-report/sorter.js.meta +1 -1
- package/coverage/lcov-report/transform-docs-to-wiki.js.html +1 -1
- package/coverage/lcov-report/transform-docs-to-wiki.js.html.meta +7 -7
- package/coverage/lcov-report/vendor.meta +1 -1
- package/coverage/lcov-report.meta +8 -8
- package/coverage/lcov.info +365 -0
- package/coverage/lcov.info.meta +7 -7
- package/docs/architecture/design-and-architecture.md +0 -1
- package/docs/concepts/index.md +37 -0
- package/docs/concepts/index.md.meta +7 -0
- package/docs/concepts/interceptors-and-ordering.md +0 -2
- package/docs/concepts/mental-model.md +390 -0
- package/docs/concepts/mental-model.md.meta +7 -0
- package/docs/concepts/message-types.md +0 -1
- package/docs/getting-started/getting-started.md +1 -0
- package/docs/getting-started/index.md +6 -5
- package/docs/getting-started/overview.md +1 -0
- package/docs/getting-started/quick-start.md +2 -1
- package/docs/getting-started/visual-guide.md +4 -10
- package/docs/hooks.py +10 -1
- package/docs/images/DxMessaging-banner.svg +1 -1
- package/docs/index.md +7 -7
- package/docs/javascripts/mermaid-config.js +44 -4
- package/docs/reference/helpers.md +130 -154
- package/docs/reference/quick-reference.md +5 -1
- package/docs/reference/reference.md +124 -130
- package/mkdocs.yml +2 -0
- package/package.json +1 -1
- package/scripts/__tests__/generate-skills-index.test.js +397 -0
- package/scripts/__tests__/generate-skills-index.test.js.meta +7 -0
- package/scripts/__tests__/mermaid-config.test.js +467 -0
- package/scripts/__tests__/mermaid-config.test.js.meta +7 -0
- package/scripts/__tests__/validate-skills-optional-fields.test.js +1474 -0
- package/scripts/__tests__/validate-skills-optional-fields.test.js.meta +7 -0
- package/scripts/__tests__/validate-skills-required-fields.test.js +188 -0
- package/scripts/__tests__/validate-skills-required-fields.test.js.meta +7 -0
- package/scripts/__tests__/validate-skills-tags.test.js +353 -0
- package/scripts/__tests__/validate-skills-tags.test.js.meta +7 -0
- package/scripts/__tests__/validate-workflows.test.js +188 -0
- package/scripts/__tests__/validate-workflows.test.js.meta +7 -0
- package/scripts/generate-skills-index.js +88 -3
- package/scripts/validate-skills.js +230 -30
- package/scripts/validate-workflows.js +272 -0
- package/scripts/validate-workflows.js.meta +7 -0
- package/site/404.html +1 -1
- package/site/advanced/emit-shorthands/index.html +2 -2
- package/site/advanced/message-bus-providers/index.html +2 -2
- package/site/advanced/registration-builders/index.html +2 -2
- package/site/advanced/runtime-configuration/index.html +2 -2
- package/site/advanced/string-messages/index.html +2 -2
- package/site/advanced.meta +1 -1
- package/site/architecture/comparisons/index.html +2 -2
- package/site/architecture/design-and-architecture/index.html +2 -2
- package/site/architecture/performance/index.html +1 -1
- package/site/architecture.meta +1 -1
- package/site/concepts/index.html +1 -0
- package/site/concepts/index.html.meta +7 -0
- package/site/concepts/interceptors-and-ordering/index.html +4 -4
- package/site/concepts/listening-patterns/index.html +2 -2
- package/site/concepts/mental-model/index.html +146 -0
- package/site/concepts/mental-model/index.html.meta +7 -0
- package/site/concepts/mental-model.meta +8 -0
- package/site/concepts/message-types/index.html +2 -2
- package/site/concepts/targeting-and-context/index.html +2 -2
- package/site/concepts.meta +1 -1
- package/site/examples/end-to-end/index.html +2 -2
- package/site/examples/end-to-end-scene-transitions/index.html +2 -2
- package/site/examples.meta +1 -1
- package/site/getting-started/getting-started/index.html +3 -3
- package/site/getting-started/index.html +4 -4
- package/site/getting-started/install/index.html +3 -3
- package/site/getting-started/overview/index.html +2 -2
- package/site/getting-started/quick-start/index.html +2 -2
- package/site/getting-started/visual-guide/index.html +11 -11
- package/site/getting-started.meta +1 -1
- package/site/guides/advanced/index.html +2 -2
- package/site/guides/diagnostics/index.html +2 -2
- package/site/guides/migration-guide/index.html +2 -2
- package/site/guides/patterns/index.html +2 -2
- package/site/guides/testing/index.html +2 -2
- package/site/guides/unity-integration/index.html +2 -2
- package/site/guides.meta +1 -1
- package/site/hooks.py.meta +1 -1
- package/site/images/DxMessaging-banner.svg +119 -0
- package/site/images/DxMessaging-banner.svg.meta +7 -0
- package/site/images.meta +8 -0
- package/site/index.html +2 -2
- package/site/integrations/index.html +2 -2
- package/site/integrations/reflex/index.html +2 -2
- package/site/integrations/vcontainer/index.html +2 -2
- package/site/integrations/zenject/index.html +2 -2
- package/site/integrations.meta +1 -1
- package/site/javascripts/csharp-highlight.js.meta +7 -7
- package/site/javascripts/mermaid-config.js +4 -1
- package/site/javascripts/mermaid-config.js.meta +1 -1
- package/site/javascripts.meta +1 -1
- package/site/reference/compatibility/index.html +1 -1
- package/site/reference/faq/index.html +1 -1
- package/site/reference/glossary/index.html +2 -2
- package/site/reference/helpers/index.html +15 -15
- package/site/reference/quick-reference/index.html +3 -3
- package/site/reference/reference/index.html +37 -37
- package/site/reference/troubleshooting/index.html +1 -1
- package/site/reference.meta +1 -1
- package/site/search/search_index.json +1 -1
- package/site/sitemap.xml +46 -38
- package/site/sitemap.xml.gz +0 -0
- package/site/stylesheets/extra.css.meta +1 -1
- package/site/stylesheets.meta +1 -1
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
* 2. Initializes Mermaid with appropriate theme variables
|
|
7
7
|
* 3. Listens for theme changes and re-renders diagrams
|
|
8
8
|
* 4. Uses semantic class-based styling that works with both themes
|
|
9
|
+
* 5. Strips per-diagram %%{init:...}%% directives to prevent theme override conflicts
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
* IMPORTANT: Do not use %%{init: {'theme': '...'}}%% directives in docs/ markdown files.
|
|
12
|
+
* This script manages theming globally and per-diagram directives bypass the theme switching,
|
|
13
|
+
* causing diagrams to render incorrectly in light mode. The stripping function below removes
|
|
14
|
+
* such directives before rendering to ensure consistent behavior.
|
|
12
15
|
*/
|
|
13
16
|
|
|
14
17
|
(function () {
|
|
@@ -116,6 +119,38 @@
|
|
|
116
119
|
sequenceNumberColor: "#1e1e1e",
|
|
117
120
|
};
|
|
118
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Regex pattern to match Mermaid init directives
|
|
124
|
+
* Matches %%{init: {...}}%% at the start of any line in diagram source
|
|
125
|
+
*
|
|
126
|
+
* SYNC: Keep pattern in sync with scripts/__tests__/mermaid-config.test.js INIT_DIRECTIVE_PATTERN
|
|
127
|
+
*
|
|
128
|
+
* Flags (gims):
|
|
129
|
+
* - 'g' (global): Finds and replaces all occurrences, not just the first one
|
|
130
|
+
* - 'i' (case-insensitive): Matches regardless of case (e.g., `%%{Init:...}%%` or `%%{INIT:...}%%`)
|
|
131
|
+
* - 'm' (multiline): Makes '^' match at the start of every line, not just the start of the string -
|
|
132
|
+
* this ensures init directives are stripped wherever they appear in the diagram source
|
|
133
|
+
* - 's' (dotAll): Makes '.' match any character including newlines, allowing '.*?' to span
|
|
134
|
+
* multi-line directives
|
|
135
|
+
*
|
|
136
|
+
* These directives can override our theme settings, so we strip them.
|
|
137
|
+
* We use [ \t]* instead of \s* around the directive to avoid consuming newlines,
|
|
138
|
+
* which would concatenate adjacent diagram lines and break Mermaid syntax.
|
|
139
|
+
*/
|
|
140
|
+
const INIT_DIRECTIVE_PATTERN = /^[ \t]*%%\{init:.*?\}%%[ \t]*\r?\n?/gims;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Strip per-diagram init directives that would override our theme configuration
|
|
144
|
+
*
|
|
145
|
+
* SYNC: Keep logic in sync with scripts/__tests__/mermaid-config.test.js stripInitDirectives
|
|
146
|
+
*
|
|
147
|
+
* @param {string} source - The original Mermaid diagram source
|
|
148
|
+
* @returns {string} The source with init directives removed
|
|
149
|
+
*/
|
|
150
|
+
function stripInitDirectives(source) {
|
|
151
|
+
return source.replace(INIT_DIRECTIVE_PATTERN, "");
|
|
152
|
+
}
|
|
153
|
+
|
|
119
154
|
/**
|
|
120
155
|
* Detect if dark theme is currently active
|
|
121
156
|
* MkDocs Material uses data-md-color-scheme attribute on body
|
|
@@ -205,8 +240,11 @@
|
|
|
205
240
|
// Generate unique ID for this diagram
|
|
206
241
|
const id = `mermaid-diagram-${Date.now()}-${i}`;
|
|
207
242
|
|
|
243
|
+
// Strip any per-diagram init directives that would override our theme
|
|
244
|
+
const cleanedDefinition = stripInitDirectives(graphDefinition);
|
|
245
|
+
|
|
208
246
|
// Render the diagram
|
|
209
|
-
const { svg } = await mermaid.render(id,
|
|
247
|
+
const { svg } = await mermaid.render(id, cleanedDefinition);
|
|
210
248
|
element.innerHTML = svg;
|
|
211
249
|
element.setAttribute("data-processed", "true");
|
|
212
250
|
} catch (error) {
|
|
@@ -245,7 +283,9 @@
|
|
|
245
283
|
|
|
246
284
|
try {
|
|
247
285
|
const id = `mermaid-rerender-${Date.now()}-${i}`;
|
|
248
|
-
|
|
286
|
+
// Strip any per-diagram init directives that would override our theme
|
|
287
|
+
const cleanedSource = stripInitDirectives(originalSource);
|
|
288
|
+
const { svg } = await mermaid.render(id, cleanedSource);
|
|
249
289
|
element.innerHTML = svg;
|
|
250
290
|
} catch (error) {
|
|
251
291
|
console.error("Mermaid re-rendering error:", error);
|
|
@@ -162,29 +162,25 @@ var settings4 = new SettingsChanged(0.8f, 2, brightness: 50); // fullscreen=f
|
|
|
162
162
|
|
|
163
163
|
The attribute provides constructor overloads for all common primitive types:
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
For enums, Unity types, and other complex types, use the `Expression` property.
|
|
186
|
-
|
|
187
|
-
<!-- markdownlint-enable MD046 -->
|
|
165
|
+
> ℹ️ **Info: Built-in Type Support**
|
|
166
|
+
>
|
|
167
|
+
> **Numeric:**
|
|
168
|
+
>
|
|
169
|
+
> | Category | Types |
|
|
170
|
+
> | --------------------- | --------------------------------- |
|
|
171
|
+
> | **Signed Integers** | `sbyte`, `short`, `int`, `long` |
|
|
172
|
+
> | **Unsigned Integers** | `byte`, `ushort`, `uint`, `ulong` |
|
|
173
|
+
> | **Floating Point** | `float`, `double` |
|
|
174
|
+
>
|
|
175
|
+
> **Other:**
|
|
176
|
+
>
|
|
177
|
+
> | Category | Types |
|
|
178
|
+
> | ------------- | -------- |
|
|
179
|
+
> | **Boolean** | `bool` |
|
|
180
|
+
> | **Character** | `char` |
|
|
181
|
+
> | **String** | `string` |
|
|
182
|
+
>
|
|
183
|
+
> For enums, Unity types, and other complex types, use the `Expression` property.
|
|
188
184
|
|
|
189
185
|
##### Examples by type
|
|
190
186
|
|
|
@@ -294,16 +290,12 @@ public readonly partial struct AdvancedDefaults
|
|
|
294
290
|
}
|
|
295
291
|
```
|
|
296
292
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
- Type safety is enforced by the C# compiler at build time
|
|
304
|
-
- Perfect for enums, nullable types, static constants, or complex defaults
|
|
305
|
-
|
|
306
|
-
<!-- markdownlint-enable MD046 -->
|
|
293
|
+
> 💡 **Tip: Expression rules**
|
|
294
|
+
>
|
|
295
|
+
> - The expression is inserted **verbatim** into the generated code
|
|
296
|
+
> - Must be a valid C# constant expression
|
|
297
|
+
> - Type safety is enforced by the C# compiler at build time
|
|
298
|
+
> - Perfect for enums, nullable types, static constants, or complex defaults
|
|
307
299
|
|
|
308
300
|
#### Code Examples
|
|
309
301
|
|
|
@@ -411,17 +403,13 @@ new AudioSettingsChanged(0.7f, 0.6f, 0.9f, false).Emit();
|
|
|
411
403
|
|
|
412
404
|
#### Best Practices
|
|
413
405
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
1. **Use Expression for complex types** — Don't fight the type system; use `Expression` for enums and Unity types
|
|
422
|
-
1. **Document unusual defaults** — If a default isn't obvious, add a comment explaining why
|
|
423
|
-
|
|
424
|
-
<!-- markdownlint-enable MD046 -->
|
|
406
|
+
> ✅ **Success: Recommendations**
|
|
407
|
+
>
|
|
408
|
+
> 1. **Order matters** — Place required fields before optional fields in your struct
|
|
409
|
+
> 1. **Use meaningful defaults** — Choose defaults that represent the most common use case
|
|
410
|
+
> 1. **Prefer explicit values** — Use `[DxOptionalParameter(0)]` instead of `[DxOptionalParameter]` when clarity helps
|
|
411
|
+
> 1. **Use Expression for complex types** — Don't fight the type system; use `Expression` for enums and Unity types
|
|
412
|
+
> 1. **Document unusual defaults** — If a default isn't obvious, add a comment explaining why
|
|
425
413
|
|
|
426
414
|
## Why Use Attributes Instead of Manual Implementation
|
|
427
415
|
|
|
@@ -638,42 +626,38 @@ msg.Emit(testBus);
|
|
|
638
626
|
|
|
639
627
|
### Message Type Attributes
|
|
640
628
|
|
|
641
|
-
|
|
629
|
+
#### Untargeted
|
|
642
630
|
|
|
643
|
-
|
|
631
|
+
Mark as a global message (no target):
|
|
644
632
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
public readonly partial struct GamePaused { }
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
=== "Targeted"
|
|
633
|
+
```csharp
|
|
634
|
+
[DxUntargetedMessage]
|
|
635
|
+
public readonly partial struct GamePaused { }
|
|
636
|
+
```
|
|
653
637
|
|
|
654
|
-
|
|
638
|
+
#### Targeted
|
|
655
639
|
|
|
656
|
-
|
|
657
|
-
[DxTargetedMessage]
|
|
658
|
-
public readonly partial struct Heal
|
|
659
|
-
{
|
|
660
|
-
public readonly int amount;
|
|
661
|
-
}
|
|
662
|
-
```
|
|
640
|
+
Mark as a message sent to a specific target:
|
|
663
641
|
|
|
664
|
-
|
|
642
|
+
```csharp
|
|
643
|
+
[DxTargetedMessage]
|
|
644
|
+
public readonly partial struct Heal
|
|
645
|
+
{
|
|
646
|
+
public readonly int amount;
|
|
647
|
+
}
|
|
648
|
+
```
|
|
665
649
|
|
|
666
|
-
|
|
650
|
+
#### Broadcast
|
|
667
651
|
|
|
668
|
-
|
|
669
|
-
[DxBroadcastMessage]
|
|
670
|
-
public readonly partial struct TookDamage
|
|
671
|
-
{
|
|
672
|
-
public readonly int amount;
|
|
673
|
-
}
|
|
674
|
-
```
|
|
652
|
+
Mark as a message broadcast from a source:
|
|
675
653
|
|
|
676
|
-
|
|
654
|
+
```csharp
|
|
655
|
+
[DxBroadcastMessage]
|
|
656
|
+
public readonly partial struct TookDamage
|
|
657
|
+
{
|
|
658
|
+
public readonly int amount;
|
|
659
|
+
}
|
|
660
|
+
```
|
|
677
661
|
|
|
678
662
|
### Constructor Generation Attributes
|
|
679
663
|
|
|
@@ -695,39 +679,35 @@ public readonly partial struct Damage
|
|
|
695
679
|
|
|
696
680
|
Makes a constructor parameter optional. Three usage patterns:
|
|
697
681
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
// Generates: DamageType damageType = DamageType.Physical
|
|
728
|
-
```
|
|
729
|
-
|
|
730
|
-
<!-- markdownlint-enable MD046 -->
|
|
682
|
+
> 📋 **Example: Default Value (type default)**
|
|
683
|
+
>
|
|
684
|
+
> Uses the type's default value (`0`, `false`, `null`, etc.):
|
|
685
|
+
>
|
|
686
|
+
> ```csharp
|
|
687
|
+
> [DxOptionalParameter]
|
|
688
|
+
> public readonly bool flag;
|
|
689
|
+
> // Generates: bool flag = default
|
|
690
|
+
> ```
|
|
691
|
+
>
|
|
692
|
+
> 📋 **Example: Custom Value (primitive)**
|
|
693
|
+
>
|
|
694
|
+
> Provides a specific default value:
|
|
695
|
+
>
|
|
696
|
+
> ```csharp
|
|
697
|
+
> [DxOptionalParameter(42)]
|
|
698
|
+
> public readonly int count;
|
|
699
|
+
> // Generates: int count = 42
|
|
700
|
+
> ```
|
|
701
|
+
>
|
|
702
|
+
> 📋 **Example: Expression (complex types)**
|
|
703
|
+
>
|
|
704
|
+
> Uses a verbatim expression for enums, Unity types, etc.:
|
|
705
|
+
>
|
|
706
|
+
> ```csharp
|
|
707
|
+
> [DxOptionalParameter(Expression = "DamageType.Physical")]
|
|
708
|
+
> public readonly DamageType damageType;
|
|
709
|
+
> // Generates: DamageType damageType = DamageType.Physical
|
|
710
|
+
> ```
|
|
731
711
|
|
|
732
712
|
### Supported Types
|
|
733
713
|
|
|
@@ -936,55 +916,51 @@ public readonly partial struct MessageA
|
|
|
936
916
|
|
|
937
917
|
## Troubleshooting Source Generators
|
|
938
918
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
1. Reopen Unity
|
|
985
|
-
1. Let it reimport everything
|
|
986
|
-
|
|
987
|
-
<!-- markdownlint-enable MD046 -->
|
|
919
|
+
> ⚠️ **Warning: Attributes not working / code not generated**
|
|
920
|
+
>
|
|
921
|
+
> ### Checklist
|
|
922
|
+
>
|
|
923
|
+
> 1. ✅ Is type marked `partial`?
|
|
924
|
+
> 1. ✅ Did you rebuild the project?
|
|
925
|
+
> 1. ✅ Is Unity 2021.3+ (Roslyn source generator support)?
|
|
926
|
+
> 1. ✅ Check `obj/` folder for `.g.cs` files
|
|
927
|
+
>
|
|
928
|
+
> #### Fix
|
|
929
|
+
>
|
|
930
|
+
> ```csharp
|
|
931
|
+
> // ❌ Missing partial, will not compile
|
|
932
|
+
> [DxAutoConstructor]
|
|
933
|
+
> public readonly struct MyMsg { }
|
|
934
|
+
>
|
|
935
|
+
> // ✅ Correct
|
|
936
|
+
> [DxAutoConstructor]
|
|
937
|
+
> public readonly partial struct MyMsg { }
|
|
938
|
+
> ```
|
|
939
|
+
>
|
|
940
|
+
> ⚠️ **Warning: Constructor not generated**
|
|
941
|
+
>
|
|
942
|
+
> **Cause:** No public fields to generate from
|
|
943
|
+
>
|
|
944
|
+
> ```csharp
|
|
945
|
+
> // ❌ No public fields
|
|
946
|
+
> [DxAutoConstructor]
|
|
947
|
+
> public readonly partial struct Empty { }
|
|
948
|
+
>
|
|
949
|
+
> // ✅ Has public field
|
|
950
|
+
> [DxAutoConstructor]
|
|
951
|
+
> public readonly partial struct WithData {
|
|
952
|
+
> public readonly int value;
|
|
953
|
+
> }
|
|
954
|
+
> ```
|
|
955
|
+
>
|
|
956
|
+
> ⚠️ **Warning: Unity can't find generated code**
|
|
957
|
+
>
|
|
958
|
+
> ##### Solution
|
|
959
|
+
>
|
|
960
|
+
> 1. Close Unity
|
|
961
|
+
> 1. Delete `Library/` folder
|
|
962
|
+
> 1. Reopen Unity
|
|
963
|
+
> 1. Let it reimport everything
|
|
988
964
|
|
|
989
965
|
## Related Documentation
|
|
990
966
|
|
|
@@ -177,7 +177,11 @@ Interceptors → Global Accept-All → Handlers<T> @ source
|
|
|
177
177
|
→ Post-Processors<T> (All Sources)
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
> 📝 **Note: Priority Rules**
|
|
181
|
+
>
|
|
182
|
+
> - Lower priority values run earlier
|
|
183
|
+
> - Same priority preserves registration order
|
|
184
|
+
> - Within a priority, fast (by-ref) handlers run before action handlers
|
|
181
185
|
|
|
182
186
|
## API Quick Reference
|
|
183
187
|
|