com.wallstop-studios.dxmessaging 2.2.0 → 3.0.1

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.
Files changed (248) hide show
  1. package/CHANGELOG.md +106 -67
  2. package/CHANGELOG.md.meta +7 -7
  3. package/Editor/Analyzers/BaseCallIlInspector.cs +277 -0
  4. package/Editor/Analyzers/BaseCallIlInspector.cs.meta +11 -0
  5. package/Editor/Analyzers/BaseCallLogMessageParser.cs +295 -0
  6. package/Editor/Analyzers/BaseCallLogMessageParser.cs.meta +11 -0
  7. package/Editor/Analyzers/BaseCallReportAggregator.cs +308 -0
  8. package/Editor/Analyzers/BaseCallReportAggregator.cs.meta +11 -0
  9. package/Editor/Analyzers/BaseCallTypeScanner.cs +110 -0
  10. package/Editor/Analyzers/BaseCallTypeScanner.cs.meta +11 -0
  11. package/Editor/Analyzers/BaseCallTypeScannerCore.cs +562 -0
  12. package/Editor/Analyzers/BaseCallTypeScannerCore.cs.meta +11 -0
  13. package/Editor/Analyzers/DxMessagingConsoleHarvester.cs +1122 -0
  14. package/Editor/Analyzers/DxMessagingConsoleHarvester.cs.meta +11 -0
  15. package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +44 -44
  16. package/Editor/Analyzers/Microsoft.CodeAnalysis.dll.meta +44 -44
  17. package/Editor/Analyzers/System.Collections.Immutable.dll.meta +44 -44
  18. package/Editor/Analyzers/System.Reflection.Metadata.dll.meta +44 -44
  19. package/Editor/Analyzers/System.Runtime.CompilerServices.Unsafe.dll.meta +44 -44
  20. package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll +0 -0
  21. package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll.meta +33 -0
  22. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll +0 -0
  23. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +72 -72
  24. package/Editor/Analyzers.meta +8 -8
  25. package/Editor/AssemblyInfo.cs.meta +3 -3
  26. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs +81 -0
  27. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs.meta +11 -0
  28. package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs +420 -0
  29. package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs.meta +11 -0
  30. package/Editor/CustomEditors/MessagingComponentEditor.cs +1 -1
  31. package/Editor/CustomEditors/MessagingComponentEditor.cs.meta +2 -2
  32. package/Editor/CustomEditors.meta +2 -2
  33. package/Editor/DxMessagingEditorInitializer.cs.meta +2 -2
  34. package/Editor/DxMessagingMenu.cs.meta +11 -11
  35. package/Editor/DxMessagingSceneBuildProcessor.cs.meta +11 -11
  36. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs +190 -0
  37. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs.meta +11 -0
  38. package/Editor/Settings/DxMessagingSettings.cs +189 -0
  39. package/Editor/Settings/DxMessagingSettings.cs.meta +2 -2
  40. package/Editor/Settings/DxMessagingSettingsProvider.cs +50 -33
  41. package/Editor/Settings/DxMessagingSettingsProvider.cs.meta +2 -2
  42. package/Editor/Settings.meta +2 -2
  43. package/Editor/SetupCscRsp.cs +209 -8
  44. package/Editor/SetupCscRsp.cs.meta +2 -2
  45. package/Editor/Testing/MessagingComponentEditorHarness.cs +1 -1
  46. package/Editor/Testing/MessagingComponentEditorHarness.cs.meta +3 -3
  47. package/Editor/Testing.meta +3 -3
  48. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef +14 -14
  49. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef.meta +7 -7
  50. package/Editor.meta +8 -8
  51. package/LICENSE.md +9 -9
  52. package/LICENSE.md.meta +7 -7
  53. package/README.md +941 -900
  54. package/README.md.meta +7 -7
  55. package/Runtime/AssemblyInfo.cs +4 -0
  56. package/Runtime/AssemblyInfo.cs.meta +2 -2
  57. package/Runtime/Core/Attributes/DxAutoConstructorAttribute.cs.meta +2 -2
  58. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs.meta +2 -2
  59. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs +26 -0
  60. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs.meta +11 -0
  61. package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs.meta +2 -2
  62. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs.meta +2 -2
  63. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs.meta +2 -2
  64. package/Runtime/Core/Attributes.meta +2 -2
  65. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs +195 -0
  66. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs.meta +11 -0
  67. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs +179 -0
  68. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs.meta +11 -0
  69. package/Runtime/Core/Configuration.meta +9 -0
  70. package/Runtime/Core/DataStructure/CyclicBuffer.cs +2 -2
  71. package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +2 -2
  72. package/Runtime/Core/DataStructure.meta +2 -2
  73. package/Runtime/Core/Diagnostics/MessageEmissionData.cs.meta +2 -2
  74. package/Runtime/Core/Diagnostics/MessageRegistrationData.cs.meta +2 -2
  75. package/Runtime/Core/Diagnostics/MessageRegistrationType.cs.meta +2 -2
  76. package/Runtime/Core/Diagnostics.meta +2 -2
  77. package/Runtime/Core/DxMessagingStaticState.cs +19 -0
  78. package/Runtime/Core/DxMessagingStaticState.cs.meta +11 -11
  79. package/Runtime/Core/Extensions/EnumExtensions.cs.meta +2 -2
  80. package/Runtime/Core/Extensions/IListExtensions.cs.meta +2 -2
  81. package/Runtime/Core/Extensions/MessageBusExtensions.cs.meta +12 -12
  82. package/Runtime/Core/Extensions/MessageExtensions.cs.meta +11 -11
  83. package/Runtime/Core/Extensions.meta +8 -8
  84. package/Runtime/Core/Helper/MessageCache.cs +32 -0
  85. package/Runtime/Core/Helper/MessageCache.cs.meta +2 -2
  86. package/Runtime/Core/Helper/MessageHelperIndexer.cs.meta +2 -2
  87. package/Runtime/Core/Helper.meta +2 -2
  88. package/Runtime/Core/IMessage.cs +3 -3
  89. package/Runtime/Core/IMessage.cs.meta +11 -11
  90. package/Runtime/Core/InstanceId.cs.meta +11 -11
  91. package/Runtime/Core/Internal/TypedDispatchLinkIndex.cs +51 -0
  92. package/Runtime/Core/Internal/TypedDispatchLinkIndex.cs.meta +11 -0
  93. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs +38 -0
  94. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs.meta +11 -0
  95. package/Runtime/Core/Internal/TypedSlotIndex.cs +81 -0
  96. package/Runtime/Core/Internal/TypedSlotIndex.cs.meta +11 -0
  97. package/Runtime/Core/Internal/TypedSlots.cs +613 -0
  98. package/Runtime/Core/Internal/TypedSlots.cs.meta +11 -0
  99. package/Runtime/Core/Internal.meta +9 -0
  100. package/Runtime/Core/MessageBus/DiagnosticsTarget.cs.meta +11 -11
  101. package/Runtime/Core/MessageBus/GlobalMessageBusProvider.cs.meta +11 -11
  102. package/Runtime/Core/MessageBus/IMessageBus.cs +177 -3
  103. package/Runtime/Core/MessageBus/IMessageBus.cs.meta +11 -11
  104. package/Runtime/Core/MessageBus/IMessageBusProvider.cs.meta +11 -11
  105. package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs.meta +11 -11
  106. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs +16 -0
  107. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs.meta +11 -0
  108. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs +40 -0
  109. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs.meta +11 -0
  110. package/Runtime/Core/MessageBus/Internal/BusSlots.cs +718 -0
  111. package/Runtime/Core/MessageBus/Internal/BusSlots.cs.meta +11 -0
  112. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs +38 -0
  113. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs.meta +11 -0
  114. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs +20 -0
  115. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs.meta +11 -0
  116. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs +28 -0
  117. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs.meta +11 -0
  118. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs +48 -0
  119. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs.meta +11 -0
  120. package/Runtime/Core/MessageBus/Internal/ISweepable.cs +15 -0
  121. package/Runtime/Core/MessageBus/Internal/ISweepable.cs.meta +11 -0
  122. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs +222 -0
  123. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs.meta +11 -0
  124. package/Runtime/Core/MessageBus/Internal/SlotKey.cs +192 -0
  125. package/Runtime/Core/MessageBus/Internal/SlotKey.cs.meta +11 -0
  126. package/Runtime/Core/MessageBus/Internal.meta +9 -0
  127. package/Runtime/Core/MessageBus/MessageBus.cs +2651 -500
  128. package/Runtime/Core/MessageBus/MessageBus.cs.meta +11 -11
  129. package/Runtime/Core/MessageBus/MessageBusRebindMode.cs.meta +11 -11
  130. package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs.meta +11 -11
  131. package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +11 -11
  132. package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +11 -11
  133. package/Runtime/Core/MessageBus.meta +8 -8
  134. package/Runtime/Core/MessageHandler.cs +2019 -542
  135. package/Runtime/Core/MessageHandler.cs.meta +11 -11
  136. package/Runtime/Core/MessageRegistrationHandle.cs.meta +11 -11
  137. package/Runtime/Core/MessageRegistrationToken.cs +7 -0
  138. package/Runtime/Core/MessageRegistrationToken.cs.meta +11 -11
  139. package/Runtime/Core/Messages/GlobalStringMessage.cs.meta +2 -2
  140. package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +11 -11
  141. package/Runtime/Core/Messages/ITargetedMessage.cs.meta +11 -11
  142. package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +11 -11
  143. package/Runtime/Core/Messages/ReflexiveMessage.cs.meta +2 -2
  144. package/Runtime/Core/Messages/SourcedStringMessage.cs.meta +11 -11
  145. package/Runtime/Core/Messages/StringMessage.cs.meta +2 -2
  146. package/Runtime/Core/Messages.meta +8 -8
  147. package/Runtime/Core/MessagingDebug.cs.meta +11 -11
  148. package/Runtime/Core/Pooling/CollectionPool.cs +266 -0
  149. package/Runtime/Core/Pooling/CollectionPool.cs.meta +11 -0
  150. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs +30 -0
  151. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs.meta +11 -0
  152. package/Runtime/Core/Pooling/DxPools.cs +157 -0
  153. package/Runtime/Core/Pooling/DxPools.cs.meta +11 -0
  154. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs +106 -0
  155. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs.meta +11 -0
  156. package/Runtime/Core/Pooling/IDxMessagingClock.cs +18 -0
  157. package/Runtime/Core/Pooling/IDxMessagingClock.cs.meta +11 -0
  158. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs +55 -0
  159. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs.meta +11 -0
  160. package/Runtime/Core/Pooling/StopwatchClock.cs +27 -0
  161. package/Runtime/Core/Pooling/StopwatchClock.cs.meta +11 -0
  162. package/Runtime/Core/Pooling/UnityRealtimeClock.cs +31 -0
  163. package/Runtime/Core/Pooling/UnityRealtimeClock.cs.meta +11 -0
  164. package/Runtime/Core/Pooling.meta +9 -0
  165. package/Runtime/Core.meta +8 -8
  166. package/Runtime/Unity/CurrentGlobalMessageBusProvider.cs.meta +12 -12
  167. package/Runtime/Unity/DxMessagingRuntimeInitializer.cs.meta +11 -11
  168. package/Runtime/Unity/InitialGlobalMessageBusProvider.cs.meta +12 -12
  169. package/Runtime/Unity/Integrations/Reflex/AssemblyInfo.cs.meta +2 -2
  170. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs +73 -0
  171. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs.meta +11 -11
  172. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef +20 -20
  173. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef.meta +7 -7
  174. package/Runtime/Unity/Integrations/Reflex.meta +8 -8
  175. package/Runtime/Unity/Integrations/VContainer/AssemblyInfo.cs.meta +2 -2
  176. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs +109 -1
  177. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs.meta +11 -11
  178. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef +30 -30
  179. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef.meta +7 -7
  180. package/Runtime/Unity/Integrations/VContainer.meta +8 -8
  181. package/Runtime/Unity/Integrations/Zenject/AssemblyInfo.cs.meta +2 -2
  182. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef +30 -30
  183. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef.meta +7 -7
  184. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs +79 -1
  185. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs.meta +11 -11
  186. package/Runtime/Unity/Integrations/Zenject.meta +8 -8
  187. package/Runtime/Unity/Integrations.meta +8 -8
  188. package/Runtime/Unity/MessageAwareComponent.cs +29 -0
  189. package/Runtime/Unity/MessageAwareComponent.cs.meta +11 -11
  190. package/Runtime/Unity/MessageBusProviderHandle.cs.meta +12 -12
  191. package/Runtime/Unity/MessagingComponent.cs.meta +11 -11
  192. package/Runtime/Unity/MessagingComponentInstaller.cs.meta +12 -12
  193. package/Runtime/Unity/ScriptableMessageBusProvider.cs.meta +12 -12
  194. package/Runtime/Unity.meta +8 -8
  195. package/Runtime/WallstopStudios.DxMessaging.asmdef +14 -14
  196. package/Runtime/WallstopStudios.DxMessaging.asmdef.meta +7 -7
  197. package/Runtime.meta +8 -8
  198. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab +98 -98
  199. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab.meta +7 -7
  200. package/Samples~/DI/Prefabs.meta +8 -8
  201. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset +14 -14
  202. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset.meta +8 -8
  203. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset +14 -14
  204. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset.meta +8 -8
  205. package/Samples~/DI/Providers.meta +8 -8
  206. package/Samples~/DI/README.md +51 -51
  207. package/Samples~/DI/README.md.meta +7 -7
  208. package/Samples~/DI/Reflex/SampleInstaller.cs +7 -0
  209. package/Samples~/DI/Reflex/SampleInstaller.cs.meta +11 -11
  210. package/Samples~/DI/Reflex.meta +8 -8
  211. package/Samples~/DI/VContainer/SampleLifetimeScope.cs +6 -1
  212. package/Samples~/DI/VContainer/SampleLifetimeScope.cs.meta +11 -11
  213. package/Samples~/DI/VContainer.meta +8 -8
  214. package/Samples~/DI/Zenject/SampleInstaller.cs +8 -0
  215. package/Samples~/DI/Zenject/SampleInstaller.cs.meta +11 -11
  216. package/Samples~/DI/Zenject.meta +8 -8
  217. package/Samples~/DI.meta +8 -8
  218. package/Samples~/Mini Combat/Boot.cs.meta +11 -11
  219. package/Samples~/Mini Combat/Enemy.cs.meta +11 -11
  220. package/Samples~/Mini Combat/Messages.cs.meta +11 -11
  221. package/Samples~/Mini Combat/Player.cs.meta +11 -11
  222. package/Samples~/Mini Combat/README.md +324 -323
  223. package/Samples~/Mini Combat/README.md.meta +7 -7
  224. package/Samples~/Mini Combat/UIOverlay.cs.meta +11 -11
  225. package/Samples~/Mini Combat/Walkthrough.md +430 -430
  226. package/Samples~/Mini Combat/Walkthrough.md.meta +7 -7
  227. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef +13 -13
  228. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef.meta +7 -7
  229. package/Samples~/Mini Combat.meta +8 -8
  230. package/Samples~/UI Buttons + Inspector/DiagnosticsEnabler.cs.meta +11 -11
  231. package/Samples~/UI Buttons + Inspector/Messages.cs.meta +11 -11
  232. package/Samples~/UI Buttons + Inspector/MessagingObserver.cs.meta +11 -11
  233. package/Samples~/UI Buttons + Inspector/README.md +210 -209
  234. package/Samples~/UI Buttons + Inspector/README.md.meta +7 -7
  235. package/Samples~/UI Buttons + Inspector/UIButtonEmitter.cs.meta +11 -11
  236. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef +13 -13
  237. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef.meta +7 -7
  238. package/Samples~/UI Buttons + Inspector.meta +8 -8
  239. package/SourceGenerators/Directory.Build.props.meta +7 -7
  240. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs.meta +11 -11
  241. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs.meta +2 -2
  242. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj.meta +7 -7
  243. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.meta +8 -8
  244. package/SourceGenerators.meta +8 -8
  245. package/Third Party Notices.md +3 -3
  246. package/Third Party Notices.md.meta +7 -7
  247. package/package.json +115 -92
  248. package/package.json.meta +7 -7
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 065c780da76ee4141a4dbb274979116a
3
- TextScriptImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 065c780da76ee4141a4dbb274979116a
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -1,13 +1,13 @@
1
- {
2
- "name": "WallstopStudios.DxMessaging.MiniCombat.Sample",
3
- "rootNamespace": "WallstopStudios.DxMessaging.MiniCombat.Sample",
4
- "references": ["WallstopStudios.DxMessaging"],
5
- "includePlatforms": [],
6
- "excludePlatforms": [],
7
- "allowUnsafeCode": false,
8
- "overrideReferences": false,
9
- "precompiledReferences": [],
10
- "autoReferenced": true,
11
- "defineConstraints": [],
12
- "noEngineReferences": false
13
- }
1
+ {
2
+ "name": "WallstopStudios.DxMessaging.MiniCombat.Sample",
3
+ "rootNamespace": "WallstopStudios.DxMessaging.MiniCombat.Sample",
4
+ "references": ["WallstopStudios.DxMessaging"],
5
+ "includePlatforms": [],
6
+ "excludePlatforms": [],
7
+ "allowUnsafeCode": false,
8
+ "overrideReferences": false,
9
+ "precompiledReferences": [],
10
+ "autoReferenced": true,
11
+ "defineConstraints": [],
12
+ "noEngineReferences": false
13
+ }
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 214da26fc651d5c4aa938bcd8fa2e8cb
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 214da26fc651d5c4aa938bcd8fa2e8cb
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: bcf45ff78210b9a4d8b2d2760c777727
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: bcf45ff78210b9a4d8b2d2760c777727
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: d0b48fd7ed54f484a92ebae191f0c3dd
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: d0b48fd7ed54f484a92ebae191f0c3dd
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 2acb0c9b50158fb4bafd2bea7bfd5901
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 2acb0c9b50158fb4bafd2bea7bfd5901
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 9503762855860cd46af568c4116ee292
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 9503762855860cd46af568c4116ee292
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,209 +1,210 @@
1
- # UI Buttons + Inspector Sample
2
-
3
- > **Perfect for:** Seeing DxMessaging work with Unity UI in 60 seconds
4
-
5
- ## What You'll Learn (No Code Required!)
6
-
7
- **Stop writing button click handlers!** This sample shows you how to:
8
-
9
- 1. **Wire UI Buttons to messages** - directly from the Inspector (drag & drop)
10
- 2. **See messages flow in real-time** - watch the Console as you click
11
- 3. **Enable diagnostics** - see every message with timestamps and payloads
12
-
13
- **Why this matters:** You can add new systems (analytics, audio, achievements) that react to button clicks WITHOUT touching existing code.
14
-
15
- ---
16
-
17
- ## Comparison
18
-
19
- ### Before DxMessaging:
20
-
21
- ```csharp
22
- public class PlayButton : MonoBehaviour {
23
- [SerializeField] private GameManager gameManager; // Coupling
24
- [SerializeField] private AudioManager audio; // Coupling
25
- [SerializeField] private Analytics analytics; // Coupling
26
-
27
- public void OnClick() {
28
- gameManager.StartGame(); // Manual call
29
- audio.PlayClickSound(); // Manual call
30
- analytics.LogButtonClick(); // Manual call
31
- }
32
- }
33
- ```
34
-
35
- #### Every new system = update PlayButton script. Exhausting.
36
-
37
- ##### With DxMessaging:
38
-
39
- ```csharp
40
- public class PlayButton : MonoBehaviour {
41
- public void OnClick() {
42
- new ButtonClicked("Play").Emit();
43
- // Done! Everything reacts automatically.
44
- }
45
- }
46
- ```
47
-
48
- ###### GameManager, Audio, and Analytics listen independently without direct references.
49
-
50
- ## Import & Run (30 Seconds)
51
-
52
- ### Want to see it immediately?
53
-
54
- 1. **Window → Package Manager**
55
- 2. **Find DxMessaging** → Scroll to **Samples**
56
- 3. **"UI Buttons + Inspector"** Click **Import**
57
- 4. **Navigate to** Assets/Samples/.../UI Buttons + Inspector/
58
- 5. **Open the scene** **Press Play**
59
- 6. **Click the buttons** → Watch Console logs
60
-
61
- You are now seeing DxMessaging in action.
62
-
63
- ## Click-To-Message: The Quick Path
64
-
65
- This sample includes `UIButtonEmitter` and `MessagingObserver` components:
66
-
67
- - `UIButtonEmitter` lives on a GameObject and exposes a `Click()` method.
68
- - Hook `Click()` to a Unity UI Button’s `OnClick` from the Inspector.
69
- - `MessagingObserver` logs incoming messages to the Console during Play Mode.
70
-
71
- Steps if you’re wiring your own Button:
72
-
73
- 1. Add a `UIButtonEmitter` component to any GameObject.
74
- 1. Select your UI Button in the scene.
75
- 1. In the Button’s `On Click ()` list, click `+`.
76
- 1. Drag the GameObject with `UIButtonEmitter` into the new slot.
77
- 1. Choose `UIButtonEmitter -> Click` in the function dropdown.
78
- 1. (Optional) Set a friendly `buttonId` in the `UIButtonEmitter` Inspector.
79
- 1. Press Play and click the Button — watch the Console logs.
80
-
81
- ## What’s Happening Under The Hood
82
-
83
- When you click the Button, `UIButtonEmitter.Click()` constructs and emits messages using the simple two-line pattern:
84
-
85
- ```csharp
86
- var evt = new ButtonClicked(buttonId);
87
- evt.Emit();
88
-
89
- var text = new StringMessage($"Clicked {buttonId}");
90
- text.EmitGameObjectTargeted(gameObject);
91
- ```
92
-
93
- Why two lines? It keeps struct messages explicit and readable, works well with source generators, and mirrors the pattern used throughout the package.
94
-
95
- The listener in this sample is `MessagingObserver`, which subclasses `MessageAwareComponent` and registers handlers in one place:
96
-
97
- ```csharp
98
- protected override void RegisterMessageHandlers()
99
- {
100
- _ = Token.RegisterUntargeted<ButtonClicked>(OnButtonClicked);
101
- _ = Token.RegisterGlobalAcceptAll(OnAnyUntargeted, OnAnyTargeted, OnAnyBroadcast);
102
- }
103
- ```
104
-
105
- Handlers simply `Debug.Log(...)` the messages they receive so you can see traffic as you click.
106
-
107
- ## Diagnostics (Optional but Handy)
108
-
109
- Want to see extra internal info while you interact with the scene?
110
-
111
- - Drop the included `DiagnosticsEnabler` component on any GameObject and press Play. It toggles global diagnostics on Start:
112
-
113
- ```csharp
114
- MessageHandler.MessageBus.DiagnosticsMode = true;
115
- ```
116
-
117
- - Prefer code? You can enable/disable diagnostics yourself at runtime in any script using the same line.
118
-
119
- ## Try These Variations
120
-
121
- - Multiple buttons: Add more UI Buttons, add more `UIButtonEmitter`s, and give each a unique `buttonId`.
122
- - Targeted vs. untargeted: Notice the sample also sends a targeted `StringMessage` to the emitter’s `gameObject`.
123
- - Your own message type: Open [Messages.cs](./Messages.cs) to see how `ButtonClicked` is declared using attributes:
124
-
125
- ```csharp
126
- [DxUntargetedMessage]
127
- [DxAutoConstructor]
128
- public readonly partial struct ButtonClicked { public readonly string id; }
129
- ```
130
-
131
- Add your own partial struct next to it, then emit it from `UIButtonEmitter` using the same two-line pattern.
132
-
133
- ## Troubleshooting
134
-
135
- - Button click does nothing: Confirm the Button's `On Click ()` has the `UIButtonEmitter.Click` function assigned, and you're not editing while in Play Mode (changes revert when you exit Play Mode).
136
- - No logs in Console: Make sure a `MessagingObserver` exists in the scene and the Console isn't filtered. Diagnostics are optional basic logs should still appear without them.
137
- - Button doesn't respond: Ensure there's an `EventSystem` in the scene (Unity auto-adds one with UI); make sure the Button is interactable and not occluded by other UI.
138
-
139
- ## CRITICAL: Inheriting from MessageAwareComponent
140
-
141
- ### If you extend `MessagingObserver` or create your own scripts deriving from `MessageAwareComponent`:
142
-
143
- ### Important Guidelines
144
-
145
- 1. **ALWAYS call `base.RegisterMessageHandlers()` FIRST** in your override:
146
-
147
- ```csharp
148
- protected override void RegisterMessageHandlers() {
149
- base.RegisterMessageHandlers(); // ← MUST be first!
150
- _ = Token.RegisterUntargeted<MyMessage>(OnMyMessage);
151
- }
152
- ```
153
-
154
- **Why?** The base class registers essential handlers. Skipping this breaks functionality.
155
-
156
- 1. **If you override Unity lifecycle methods, call base:**
157
- - `base.Awake()` - Skip this = token never created = handlers never fire
158
- - `base.OnEnable()` / `base.OnDisable()` - Skip these = handlers never activate
159
- - `base.OnDestroy()` - Skip this = potential memory leaks
160
-
161
- 1. **Use `override`, never `new`:**
162
-
163
- ```csharp
164
- // ❌ WRONG - This hides the method, doesn't override it
165
- new void OnEnable() { }
166
-
167
- // ✅ CORRECT - This properly overrides
168
- protected override void OnEnable() {
169
- base.OnEnable();
170
- }
171
- ```
172
-
173
- ### Registration Timing: Use Awake, Not Start
174
-
175
- - `MessageAwareComponent` calls `RegisterMessageHandlers()` in `Awake()` automatically
176
- - **This is the correct pattern** - handlers are ready before other components' `Start()` methods
177
- - **Don't register in `Start()`** unless you have a specific order-of-execution reason
178
- - Early registration = you won't miss messages from other components
179
-
180
- ### Common Pitfall Example
181
-
182
- ```csharp
183
- // ❌ WRONG - Forgot base.RegisterMessageHandlers()
184
- public class MyObserver : MessageAwareComponent {
185
- protected override void RegisterMessageHandlers() {
186
- // Missing base call!
187
- _ = Token.RegisterUntargeted<ButtonClicked>(OnClick);
188
- }
189
- }
190
- // Result: String messages won't work, base class handlers missing
191
-
192
- // ✅ CORRECT
193
- public class MyObserver : MessageAwareComponent {
194
- protected override void RegisterMessageHandlers() {
195
- base.RegisterMessageHandlers(); // Essential!
196
- _ = Token.RegisterUntargeted<ButtonClicked>(OnClick);
197
- }
198
- }
199
- ```
200
-
201
- **Remember:** Forgetting `base.RegisterMessageHandlers()` or `base.Awake()` is the #1 cause of "handlers not firing" issues.
202
-
203
- ## Next Steps
204
-
205
- - Quick tour: [Getting Started guide](../../docs/getting-started/getting-started.md)
206
- - Patterns and recipes: [Common Patterns](../../docs/guides/patterns.md)
207
- - Explore another sample: [Mini Combat sample](../Mini%20Combat/README.md)
208
-
209
- You now have an inspector-first way to publish and observe messages. Build on this by using your own message types and listeners.
1
+ # UI Buttons + Inspector Sample
2
+
3
+ > **Perfect for:** Seeing DxMessaging work with Unity UI in 60 seconds
4
+
5
+ ## What You'll Learn (No Code Required!)
6
+
7
+ **Stop writing button click handlers!** This sample shows you how to:
8
+
9
+ 1. **Wire UI Buttons to messages** - directly from the Inspector (drag & drop)
10
+ 1. **See messages flow in real-time** - watch the Console as you click
11
+ 1. **Enable diagnostics** - see every message with timestamps and payloads
12
+
13
+ **Why this matters:** You can add new systems (analytics, audio, achievements) that react to button clicks WITHOUT touching existing code.
14
+
15
+ ---
16
+
17
+ ## Comparison
18
+
19
+ ### Before DxMessaging:
20
+
21
+ ```csharp
22
+ public class PlayButton : MonoBehaviour {
23
+ [SerializeField] private GameManager gameManager; // Coupling
24
+ [SerializeField] private AudioManager audio; // Coupling
25
+ [SerializeField] private Analytics analytics; // Coupling
26
+
27
+ public void OnClick() {
28
+ gameManager.StartGame(); // Manual call
29
+ audio.PlayClickSound(); // Manual call
30
+ analytics.LogButtonClick(); // Manual call
31
+ }
32
+ }
33
+ ```
34
+
35
+ #### Every new system = update PlayButton script. Exhausting.
36
+
37
+ ##### With DxMessaging:
38
+
39
+ ```csharp
40
+ public class PlayButton : MonoBehaviour {
41
+ public void OnClick() {
42
+ var clicked = new ButtonClicked("Play");
43
+ clicked.Emit();
44
+ // Done! Everything reacts automatically.
45
+ }
46
+ }
47
+ ```
48
+
49
+ ###### GameManager, Audio, and Analytics listen independently without direct references.
50
+
51
+ ## Import & Run (30 Seconds)
52
+
53
+ ### Want to see it immediately?
54
+
55
+ 1. **Window -> Package Manager**
56
+ 1. **Find DxMessaging** to Scroll to **Samples**
57
+ 1. **"UI Buttons + Inspector"** to Click **Import**
58
+ 1. **Navigate to** Assets/Samples/.../UI Buttons + Inspector/
59
+ 1. **Open the scene** to **Press Play**
60
+ 1. **Click the buttons** to Watch Console logs
61
+
62
+ You are now seeing DxMessaging in action.
63
+
64
+ ## Click-To-Message: The Quick Path
65
+
66
+ This sample includes `UIButtonEmitter` and `MessagingObserver` components:
67
+
68
+ - `UIButtonEmitter` lives on a GameObject and exposes a `Click()` method.
69
+ - Hook `Click()` to a Unity UI Button's `OnClick` from the Inspector.
70
+ - `MessagingObserver` logs incoming messages to the Console during Play Mode.
71
+
72
+ Steps if you're wiring your own Button:
73
+
74
+ 1. Add a `UIButtonEmitter` component to any GameObject.
75
+ 1. Select your UI Button in the scene.
76
+ 1. In the Button's `On Click ()` list, click `+`.
77
+ 1. Drag the GameObject with `UIButtonEmitter` into the new slot.
78
+ 1. Choose `UIButtonEmitter -> Click` in the function dropdown.
79
+ 1. (Optional) Set a friendly `buttonId` in the `UIButtonEmitter` Inspector.
80
+ 1. Press Play and click the Button -- watch the Console logs.
81
+
82
+ ## What's Happening Under The Hood
83
+
84
+ When you click the Button, `UIButtonEmitter.Click()` constructs and emits messages using the simple two-line pattern:
85
+
86
+ ```csharp
87
+ var evt = new ButtonClicked(buttonId);
88
+ evt.Emit();
89
+
90
+ var text = new StringMessage($"Clicked {buttonId}");
91
+ text.EmitGameObjectTargeted(gameObject);
92
+ ```
93
+
94
+ Why two lines? It keeps struct messages explicit and readable, works well with source generators, and mirrors the pattern used throughout the package.
95
+
96
+ The listener in this sample is `MessagingObserver`, which subclasses `MessageAwareComponent` and registers handlers in one place:
97
+
98
+ ```csharp
99
+ protected override void RegisterMessageHandlers()
100
+ {
101
+ _ = Token.RegisterUntargeted<ButtonClicked>(OnButtonClicked);
102
+ _ = Token.RegisterGlobalAcceptAll(OnAnyUntargeted, OnAnyTargeted, OnAnyBroadcast);
103
+ }
104
+ ```
105
+
106
+ Handlers simply `Debug.Log(...)` the messages they receive so you can see traffic as you click.
107
+
108
+ ## Diagnostics (Optional but Handy)
109
+
110
+ Want to see extra internal info while you interact with the scene?
111
+
112
+ - Drop the included `DiagnosticsEnabler` component on any GameObject and press Play. It toggles global diagnostics on Start:
113
+
114
+ ```csharp
115
+ MessageHandler.MessageBus.DiagnosticsMode = true;
116
+ ```
117
+
118
+ - Prefer code? You can enable/disable diagnostics yourself at runtime in any script using the same line.
119
+
120
+ ## Try These Variations
121
+
122
+ - Multiple buttons: Add more UI Buttons, add more `UIButtonEmitter`s, and give each a unique `buttonId`.
123
+ - Targeted vs. untargeted: Notice the sample also sends a targeted `StringMessage` to the emitter's `gameObject`.
124
+ - Your own message type: Open [Messages.cs](./Messages.cs) to see how `ButtonClicked` is declared using attributes:
125
+
126
+ ```csharp
127
+ [DxUntargetedMessage]
128
+ [DxAutoConstructor]
129
+ public readonly partial struct ButtonClicked { public readonly string id; }
130
+ ```
131
+
132
+ Add your own partial struct next to it, then emit it from `UIButtonEmitter` using the same two-line pattern.
133
+
134
+ ## Troubleshooting
135
+
136
+ - Button click does nothing: Confirm the Button's `On Click ()` has the `UIButtonEmitter.Click` function assigned, and you're not editing while in Play Mode (changes revert when you exit Play Mode).
137
+ - No logs in Console: Make sure a `MessagingObserver` exists in the scene and the Console isn't filtered. Diagnostics are optional -- basic logs should still appear without them.
138
+ - Button doesn't respond: Ensure there's an `EventSystem` in the scene (Unity auto-adds one with UI); make sure the Button is interactable and not occluded by other UI.
139
+
140
+ ## CRITICAL: Inheriting from MessageAwareComponent
141
+
142
+ ### If you extend `MessagingObserver` or create your own scripts deriving from `MessageAwareComponent`:
143
+
144
+ ### Important Guidelines
145
+
146
+ 1. **ALWAYS call `base.RegisterMessageHandlers()` FIRST** in your override:
147
+
148
+ ```csharp
149
+ protected override void RegisterMessageHandlers() {
150
+ base.RegisterMessageHandlers(); // <- MUST be first!
151
+ _ = Token.RegisterUntargeted<MyMessage>(OnMyMessage);
152
+ }
153
+ ```
154
+
155
+ **Why?** The base class registers essential handlers. Skipping this breaks functionality.
156
+
157
+ 1. **If you override Unity lifecycle methods, call base:**
158
+ - `base.Awake()` - Skip this = token never created = handlers never fire
159
+ - `base.OnEnable()` / `base.OnDisable()` - Skip these = handlers never activate
160
+ - `base.OnDestroy()` - Skip this = potential memory leaks
161
+
162
+ 1. **Use `override`, never `new`:**
163
+
164
+ ```csharp
165
+ // WRONG - This hides the method, doesn't override it
166
+ new void OnEnable() { }
167
+
168
+ // CORRECT - This properly overrides
169
+ protected override void OnEnable() {
170
+ base.OnEnable();
171
+ }
172
+ ```
173
+
174
+ ### Registration Timing: Use Awake, Not Start
175
+
176
+ - `MessageAwareComponent` calls `RegisterMessageHandlers()` in `Awake()` automatically
177
+ - **This is the correct pattern** - handlers are ready before other components' `Start()` methods
178
+ - **Don't register in `Start()`** unless you have a specific order-of-execution reason
179
+ - Early registration = you won't miss messages from other components
180
+
181
+ ### Common Pitfall Example
182
+
183
+ ```csharp
184
+ // WRONG - Forgot base.RegisterMessageHandlers()
185
+ public class MyObserver : MessageAwareComponent {
186
+ protected override void RegisterMessageHandlers() {
187
+ // Missing base call!
188
+ _ = Token.RegisterUntargeted<ButtonClicked>(OnClick);
189
+ }
190
+ }
191
+ // Result: String messages won't work, base class handlers missing
192
+
193
+ // CORRECT
194
+ public class MyObserver : MessageAwareComponent {
195
+ protected override void RegisterMessageHandlers() {
196
+ base.RegisterMessageHandlers(); // Essential!
197
+ _ = Token.RegisterUntargeted<ButtonClicked>(OnClick);
198
+ }
199
+ }
200
+ ```
201
+
202
+ **Remember:** Forgetting `base.RegisterMessageHandlers()` or `base.Awake()` is the #1 cause of "handlers not firing" issues.
203
+
204
+ ## Next Steps
205
+
206
+ - Quick tour: [Getting Started guide](../../docs/getting-started/getting-started.md)
207
+ - Patterns and recipes: [Common Patterns](../../docs/guides/patterns.md)
208
+ - Explore another sample: [Mini Combat sample](../Mini%20Combat/README.md)
209
+
210
+ You now have an inspector-first way to publish and observe messages. Build on this by using your own message types and listeners.
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 5e5eb4ac04b570c40984987663b055c6
3
- TextScriptImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 5e5eb4ac04b570c40984987663b055c6
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: c305c3841faae42429728469ff9e759a
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: c305c3841faae42429728469ff9e759a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,13 +1,13 @@
1
- {
2
- "name": "WallstopStudios.DxMessaging.UIButtons.Sample",
3
- "rootNamespace": "WallstopStudios.DxMessaging.UIButtons.Sample",
4
- "references": ["WallstopStudios.DxMessaging"],
5
- "includePlatforms": [],
6
- "excludePlatforms": [],
7
- "allowUnsafeCode": false,
8
- "overrideReferences": false,
9
- "precompiledReferences": [],
10
- "autoReferenced": true,
11
- "defineConstraints": [],
12
- "noEngineReferences": false
13
- }
1
+ {
2
+ "name": "WallstopStudios.DxMessaging.UIButtons.Sample",
3
+ "rootNamespace": "WallstopStudios.DxMessaging.UIButtons.Sample",
4
+ "references": ["WallstopStudios.DxMessaging"],
5
+ "includePlatforms": [],
6
+ "excludePlatforms": [],
7
+ "allowUnsafeCode": false,
8
+ "overrideReferences": false,
9
+ "precompiledReferences": [],
10
+ "autoReferenced": true,
11
+ "defineConstraints": [],
12
+ "noEngineReferences": false
13
+ }