com.wallstop-studios.dxmessaging 2.2.0 → 3.1.0

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 (270) hide show
  1. package/CHANGELOG.md +315 -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 +1129 -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 +46 -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 +11 -3
  26. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs +81 -0
  27. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs.meta +11 -0
  28. package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs +429 -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 +11 -3
  32. package/Editor/CustomEditors.meta +2 -2
  33. package/Editor/DxMessagingEditorIdle.cs +62 -0
  34. package/Editor/DxMessagingEditorIdle.cs.meta +11 -0
  35. package/Editor/DxMessagingEditorInitializer.cs +112 -15
  36. package/Editor/DxMessagingEditorInitializer.cs.meta +11 -3
  37. package/Editor/DxMessagingEditorLog.cs +32 -0
  38. package/Editor/DxMessagingEditorLog.cs.meta +11 -0
  39. package/Editor/DxMessagingMenu.cs.meta +11 -11
  40. package/Editor/DxMessagingSceneBuildProcessor.cs.meta +11 -11
  41. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs +313 -0
  42. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs.meta +11 -0
  43. package/Editor/Settings/DxMessagingSettings.cs +261 -11
  44. package/Editor/Settings/DxMessagingSettings.cs.meta +11 -3
  45. package/Editor/Settings/DxMessagingSettingsProvider.cs +50 -33
  46. package/Editor/Settings/DxMessagingSettingsProvider.cs.meta +11 -3
  47. package/Editor/Settings.meta +2 -2
  48. package/Editor/SetupCscRsp.cs +406 -39
  49. package/Editor/SetupCscRsp.cs.meta +11 -3
  50. package/Editor/Testing/MessagingComponentEditorHarness.cs +2 -2
  51. package/Editor/Testing/MessagingComponentEditorHarness.cs.meta +11 -3
  52. package/Editor/Testing.meta +3 -3
  53. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef +14 -14
  54. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef.meta +7 -7
  55. package/Editor.meta +8 -8
  56. package/LICENSE.md +9 -9
  57. package/LICENSE.md.meta +7 -7
  58. package/README.md +940 -900
  59. package/README.md.meta +7 -7
  60. package/Runtime/AssemblyInfo.cs +4 -0
  61. package/Runtime/AssemblyInfo.cs.meta +11 -3
  62. package/Runtime/Core/Attributes/DxAutoConstructorAttribute.cs.meta +11 -3
  63. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs.meta +11 -3
  64. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs +26 -0
  65. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs.meta +11 -0
  66. package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs +2 -4
  67. package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs.meta +11 -3
  68. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs.meta +11 -3
  69. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs.meta +11 -3
  70. package/Runtime/Core/Attributes/Il2CppSetOptionAttribute.cs +56 -0
  71. package/Runtime/Core/Attributes/Il2CppSetOptionAttribute.cs.meta +11 -0
  72. package/Runtime/Core/Attributes.meta +2 -2
  73. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs +195 -0
  74. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs.meta +11 -0
  75. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs +179 -0
  76. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs.meta +11 -0
  77. package/Runtime/Core/Configuration.meta +9 -0
  78. package/Runtime/Core/DataStructure/CyclicBuffer.cs +46 -28
  79. package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +11 -3
  80. package/Runtime/Core/DataStructure.meta +2 -2
  81. package/Runtime/Core/Diagnostics/MessageEmissionData.cs.meta +11 -3
  82. package/Runtime/Core/Diagnostics/MessageRegistrationData.cs.meta +11 -3
  83. package/Runtime/Core/Diagnostics/MessageRegistrationType.cs.meta +11 -3
  84. package/Runtime/Core/Diagnostics.meta +2 -2
  85. package/Runtime/Core/DxMessagingStaticState.cs +19 -0
  86. package/Runtime/Core/DxMessagingStaticState.cs.meta +11 -11
  87. package/Runtime/Core/Extensions/EnumExtensions.cs +6 -5
  88. package/Runtime/Core/Extensions/EnumExtensions.cs.meta +11 -3
  89. package/Runtime/Core/Extensions/IListExtensions.cs.meta +11 -3
  90. package/Runtime/Core/Extensions/MessageBusExtensions.cs.meta +12 -12
  91. package/Runtime/Core/Extensions/MessageExtensions.cs +0 -60
  92. package/Runtime/Core/Extensions/MessageExtensions.cs.meta +11 -11
  93. package/Runtime/Core/Extensions.meta +8 -8
  94. package/Runtime/Core/Helper/MessageCache.cs +32 -0
  95. package/Runtime/Core/Helper/MessageCache.cs.meta +11 -3
  96. package/Runtime/Core/Helper/MessageHelperIndexer.cs.meta +11 -3
  97. package/Runtime/Core/Helper.meta +2 -2
  98. package/Runtime/Core/IMessage.cs +3 -3
  99. package/Runtime/Core/IMessage.cs.meta +11 -11
  100. package/Runtime/Core/InstanceId.cs +25 -1
  101. package/Runtime/Core/InstanceId.cs.meta +11 -11
  102. package/Runtime/Core/Internal/DxUnsafe.cs +60 -0
  103. package/Runtime/Core/Internal/DxUnsafe.cs.meta +11 -0
  104. package/Runtime/Core/Internal/FlatDispatch.cs +198 -0
  105. package/Runtime/Core/Internal/FlatDispatch.cs.meta +11 -0
  106. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs +38 -0
  107. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs.meta +11 -0
  108. package/Runtime/Core/Internal/TypedSlotIndex.cs +81 -0
  109. package/Runtime/Core/Internal/TypedSlotIndex.cs.meta +11 -0
  110. package/Runtime/Core/Internal/TypedSlots.cs +597 -0
  111. package/Runtime/Core/Internal/TypedSlots.cs.meta +11 -0
  112. package/Runtime/Core/Internal.meta +9 -0
  113. package/Runtime/Core/MessageBus/DiagnosticsTarget.cs.meta +11 -11
  114. package/Runtime/Core/MessageBus/GlobalMessageBusProvider.cs.meta +11 -11
  115. package/Runtime/Core/MessageBus/IMessageBus.cs +189 -15
  116. package/Runtime/Core/MessageBus/IMessageBus.cs.meta +11 -11
  117. package/Runtime/Core/MessageBus/IMessageBusProvider.cs.meta +11 -11
  118. package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs +1 -0
  119. package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs.meta +11 -11
  120. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs +16 -0
  121. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs.meta +11 -0
  122. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs +40 -0
  123. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs.meta +11 -0
  124. package/Runtime/Core/MessageBus/Internal/BusSlots.cs +719 -0
  125. package/Runtime/Core/MessageBus/Internal/BusSlots.cs.meta +11 -0
  126. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs +38 -0
  127. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs.meta +11 -0
  128. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs +20 -0
  129. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs.meta +11 -0
  130. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs +28 -0
  131. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs.meta +11 -0
  132. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs +48 -0
  133. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs.meta +11 -0
  134. package/Runtime/Core/MessageBus/Internal/ISweepable.cs +15 -0
  135. package/Runtime/Core/MessageBus/Internal/ISweepable.cs.meta +11 -0
  136. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs +222 -0
  137. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs.meta +11 -0
  138. package/Runtime/Core/MessageBus/Internal/SlotKey.cs +192 -0
  139. package/Runtime/Core/MessageBus/Internal/SlotKey.cs.meta +11 -0
  140. package/Runtime/Core/MessageBus/Internal.meta +9 -0
  141. package/Runtime/Core/MessageBus/MessageBus.cs +5366 -3838
  142. package/Runtime/Core/MessageBus/MessageBus.cs.meta +11 -11
  143. package/Runtime/Core/MessageBus/MessageBusRebindMode.cs.meta +11 -11
  144. package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs +187 -14
  145. package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs.meta +11 -11
  146. package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +11 -11
  147. package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +11 -11
  148. package/Runtime/Core/MessageBus.meta +8 -8
  149. package/Runtime/Core/MessageHandler.cs +2399 -1042
  150. package/Runtime/Core/MessageHandler.cs.meta +11 -11
  151. package/Runtime/Core/MessageRegistrationHandle.cs.meta +11 -11
  152. package/Runtime/Core/MessageRegistrationToken.cs +429 -44
  153. package/Runtime/Core/MessageRegistrationToken.cs.meta +11 -11
  154. package/Runtime/Core/Messages/GlobalStringMessage.cs.meta +11 -3
  155. package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +11 -11
  156. package/Runtime/Core/Messages/ITargetedMessage.cs.meta +11 -11
  157. package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +11 -11
  158. package/Runtime/Core/Messages/ReflexiveMessage.cs.meta +11 -3
  159. package/Runtime/Core/Messages/SourcedStringMessage.cs.meta +11 -11
  160. package/Runtime/Core/Messages/StringMessage.cs.meta +11 -3
  161. package/Runtime/Core/Messages.meta +8 -8
  162. package/Runtime/Core/MessagingDebug.cs.meta +11 -11
  163. package/Runtime/Core/Pooling/CollectionPool.cs +266 -0
  164. package/Runtime/Core/Pooling/CollectionPool.cs.meta +11 -0
  165. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs +30 -0
  166. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs.meta +11 -0
  167. package/Runtime/Core/Pooling/DxPools.cs +157 -0
  168. package/Runtime/Core/Pooling/DxPools.cs.meta +11 -0
  169. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs +106 -0
  170. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs.meta +11 -0
  171. package/Runtime/Core/Pooling/IDxMessagingClock.cs +18 -0
  172. package/Runtime/Core/Pooling/IDxMessagingClock.cs.meta +11 -0
  173. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs +55 -0
  174. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs.meta +11 -0
  175. package/Runtime/Core/Pooling/StopwatchClock.cs +27 -0
  176. package/Runtime/Core/Pooling/StopwatchClock.cs.meta +11 -0
  177. package/Runtime/Core/Pooling/UnityRealtimeClock.cs +31 -0
  178. package/Runtime/Core/Pooling/UnityRealtimeClock.cs.meta +11 -0
  179. package/Runtime/Core/Pooling.meta +9 -0
  180. package/Runtime/Core.meta +8 -8
  181. package/Runtime/Unity/CurrentGlobalMessageBusProvider.cs.meta +12 -12
  182. package/Runtime/Unity/DxMessagingRuntimeInitializer.cs.meta +11 -11
  183. package/Runtime/Unity/InitialGlobalMessageBusProvider.cs.meta +12 -12
  184. package/Runtime/Unity/Integrations/Reflex/AssemblyInfo.cs.meta +11 -3
  185. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs +73 -0
  186. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs.meta +11 -11
  187. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef +20 -20
  188. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef.meta +7 -7
  189. package/Runtime/Unity/Integrations/Reflex.meta +8 -8
  190. package/Runtime/Unity/Integrations/VContainer/AssemblyInfo.cs.meta +11 -3
  191. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs +109 -1
  192. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs.meta +11 -11
  193. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef +30 -30
  194. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef.meta +7 -7
  195. package/Runtime/Unity/Integrations/VContainer.meta +8 -8
  196. package/Runtime/Unity/Integrations/Zenject/AssemblyInfo.cs.meta +11 -3
  197. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef +30 -30
  198. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef.meta +7 -7
  199. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs +79 -1
  200. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs.meta +11 -11
  201. package/Runtime/Unity/Integrations/Zenject.meta +8 -8
  202. package/Runtime/Unity/Integrations.meta +8 -8
  203. package/Runtime/Unity/MessageAwareComponent.cs +74 -0
  204. package/Runtime/Unity/MessageAwareComponent.cs.meta +11 -11
  205. package/Runtime/Unity/MessageBusProviderHandle.cs.meta +12 -12
  206. package/Runtime/Unity/MessagingComponent.cs +43 -10
  207. package/Runtime/Unity/MessagingComponent.cs.meta +11 -11
  208. package/Runtime/Unity/MessagingComponentInstaller.cs.meta +12 -12
  209. package/Runtime/Unity/ScriptableMessageBusProvider.cs.meta +12 -12
  210. package/Runtime/Unity.meta +8 -8
  211. package/Runtime/WallstopStudios.DxMessaging.asmdef +14 -14
  212. package/Runtime/WallstopStudios.DxMessaging.asmdef.meta +7 -7
  213. package/Runtime.meta +8 -8
  214. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab +98 -98
  215. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab.meta +7 -7
  216. package/Samples~/DI/Prefabs.meta +8 -8
  217. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset +14 -14
  218. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset.meta +8 -8
  219. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset +14 -14
  220. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset.meta +8 -8
  221. package/Samples~/DI/Providers.meta +8 -8
  222. package/Samples~/DI/README.md +51 -51
  223. package/Samples~/DI/README.md.meta +7 -7
  224. package/Samples~/DI/Reflex/SampleInstaller.cs +7 -0
  225. package/Samples~/DI/Reflex/SampleInstaller.cs.meta +11 -11
  226. package/Samples~/DI/Reflex.meta +8 -8
  227. package/Samples~/DI/VContainer/SampleLifetimeScope.cs +6 -1
  228. package/Samples~/DI/VContainer/SampleLifetimeScope.cs.meta +11 -11
  229. package/Samples~/DI/VContainer.meta +8 -8
  230. package/Samples~/DI/Zenject/SampleInstaller.cs +8 -0
  231. package/Samples~/DI/Zenject/SampleInstaller.cs.meta +11 -11
  232. package/Samples~/DI/Zenject.meta +8 -8
  233. package/Samples~/DI.meta +8 -8
  234. package/Samples~/Mini Combat/Boot.cs.meta +11 -11
  235. package/Samples~/Mini Combat/Enemy.cs.meta +11 -11
  236. package/Samples~/Mini Combat/Messages.cs.meta +11 -11
  237. package/Samples~/Mini Combat/Player.cs.meta +11 -11
  238. package/Samples~/Mini Combat/README.md +324 -323
  239. package/Samples~/Mini Combat/README.md.meta +7 -7
  240. package/Samples~/Mini Combat/UIOverlay.cs.meta +11 -11
  241. package/Samples~/Mini Combat/Walkthrough.md +430 -430
  242. package/Samples~/Mini Combat/Walkthrough.md.meta +7 -7
  243. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef +13 -13
  244. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef.meta +7 -7
  245. package/Samples~/Mini Combat.meta +8 -8
  246. package/Samples~/UI Buttons + Inspector/DiagnosticsEnabler.cs.meta +11 -11
  247. package/Samples~/UI Buttons + Inspector/Messages.cs.meta +11 -11
  248. package/Samples~/UI Buttons + Inspector/MessagingObserver.cs.meta +11 -11
  249. package/Samples~/UI Buttons + Inspector/README.md +210 -209
  250. package/Samples~/UI Buttons + Inspector/README.md.meta +7 -7
  251. package/Samples~/UI Buttons + Inspector/UIButtonEmitter.cs.meta +11 -11
  252. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef +13 -13
  253. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef.meta +7 -7
  254. package/Samples~/UI Buttons + Inspector.meta +8 -8
  255. package/SourceGenerators/Directory.Build.props +50 -3
  256. package/SourceGenerators/Directory.Build.props.meta +7 -7
  257. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs +96 -63
  258. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs.meta +11 -11
  259. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs +745 -87
  260. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs.meta +11 -3
  261. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj +39 -46
  262. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj.meta +7 -7
  263. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.meta +8 -8
  264. package/SourceGenerators/global.json +7 -0
  265. package/SourceGenerators/global.json.meta +7 -0
  266. package/SourceGenerators.meta +8 -8
  267. package/Third Party Notices.md +3 -3
  268. package/Third Party Notices.md.meta +7 -7
  269. package/package.json +102 -92
  270. package/package.json.meta +7 -7
package/README.md.meta CHANGED
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 4c1ffc4b35b01f34f81f0399aa77b4d0
3
- TextScriptImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 4c1ffc4b35b01f34f81f0399aa77b4d0
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -5,8 +5,12 @@ using System.Runtime.CompilerServices;
5
5
  AllInternalsVisible = true
6
6
  )]
7
7
  [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Editor")]
8
+ [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Reflex")]
9
+ [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.VContainer")]
10
+ [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Zenject")]
8
11
  [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Tests.Runtime")]
9
12
  [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Tests.Runtime.Reflex")]
10
13
  [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Tests.Runtime.VContainer")]
11
14
  [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Tests.Runtime.Zenject")]
12
15
  [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Tests.Editor")]
16
+ [assembly: InternalsVisibleTo("WallstopStudios.DxMessaging.Tests.Editor.Allocations")]
@@ -1,3 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 83aab80bf265483fb08c5f884e4b24fc
3
- timeCreated: 1759525804
1
+ fileFormatVersion: 2
2
+ guid: 83aab80bf265483fb08c5f884e4b24fc
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,3 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: bef6adb9baf545129cb9a841b13da451
3
- timeCreated: 1749776355
1
+ fileFormatVersion: 2
2
+ guid: bef6adb9baf545129cb9a841b13da451
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,3 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 73fd653a34be4f36b5773dce342ae9fa
3
- timeCreated: 1730779174
1
+ fileFormatVersion: 2
2
+ guid: 73fd653a34be4f36b5773dce342ae9fa
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,26 @@
1
+ namespace DxMessaging.Core.Attributes
2
+ {
3
+ using System;
4
+
5
+ /// <summary>
6
+ /// Suppresses the <c>MessageAwareComponentBaseCallAnalyzer</c> (DXMSG006/DXMSG007/DXMSG009/DXMSG010)
7
+ /// for the annotated class or method.
8
+ /// </summary>
9
+ /// <remarks>
10
+ /// Applying this attribute is the source-level opt-out for the base-call analyzer. When applied to
11
+ /// a class, every guarded lifecycle method on that class (<c>Awake</c>, <c>OnEnable</c>,
12
+ /// <c>OnDisable</c>, <c>OnDestroy</c>, <c>RegisterMessageHandlers</c>) is exempt. When applied to a
13
+ /// single method, only that method is exempt. The analyzer still emits an Info-level
14
+ /// <c>DXMSG008</c> at the suppression site so the opt-out is auditable.
15
+ /// <para>
16
+ /// <c>Inherited = false</c>: a base class's <c>[DxIgnoreMissingBaseCall]</c> does NOT silently
17
+ /// suppress derived classes. Each subclass must opt out explicitly.
18
+ /// </para>
19
+ /// </remarks>
20
+ [AttributeUsage(
21
+ AttributeTargets.Class | AttributeTargets.Method,
22
+ Inherited = false,
23
+ AllowMultiple = false
24
+ )]
25
+ public sealed class DxIgnoreMissingBaseCallAttribute : Attribute { }
26
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 5c8950d6fd6b4d409d59ff68e1eba46f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -8,6 +8,8 @@ namespace DxMessaging.Core.Attributes
8
8
  /// <remarks>
9
9
  /// The source generator will emit a constructor parameter with a default value for fields annotated
10
10
  /// with this attribute. This is helpful for messages with sensible defaults.
11
+ /// Overloads accepting explicit default values require compile-time constants and are validated by
12
+ /// the source generator against the field type.
11
13
  /// </remarks>
12
14
  /// <example>
13
15
  /// <code>
@@ -27,10 +29,6 @@ namespace DxMessaging.Core.Attributes
27
29
  /// </summary>
28
30
  public DxOptionalParameterAttribute() { }
29
31
 
30
- /// <summary>
31
- /// Optional default value overloads. Values must be compile-time constants and
32
- /// will be validated by the source generator against the field type.
33
- /// </summary>
34
32
  /// <summary>
35
33
  /// Initializes the attribute with the specified default boolean value.
36
34
  /// </summary>
@@ -1,3 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 87d96cdf2fc74f40ba77ae0d157be964
3
- timeCreated: 1749850608
1
+ fileFormatVersion: 2
2
+ guid: 87d96cdf2fc74f40ba77ae0d157be964
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,3 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: ab2509dd51f5467d95b4fca1cb794b29
3
- timeCreated: 1730779159
1
+ fileFormatVersion: 2
2
+ guid: ab2509dd51f5467d95b4fca1cb794b29
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,3 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 418b461df3764ef6896dc86524a00132
3
- timeCreated: 1730779131
1
+ fileFormatVersion: 2
2
+ guid: 418b461df3764ef6896dc86524a00132
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,56 @@
1
+ // Vendored copy of Unity's Il2CppSetOption attribute. The IL2CPP code
2
+ // generator (il2cpp.exe) matches this attribute by its FULL NAME
3
+ // (Unity.IL2CPP.CompilerServices.Il2CppSetOptionAttribute), not by assembly,
4
+ // so an internal per-assembly copy is the sanctioned way for a package to opt
5
+ // hot methods out of generated null/bounds checks (the same pattern UniTask
6
+ // and other performance-focused packages use). The shape below mirrors the
7
+ // attribute source Unity publishes in the IL2CPP documentation; do not add
8
+ // members or change the namespace. Under Mono (editor, Mono players) the
9
+ // attribute is inert.
10
+ namespace Unity.IL2CPP.CompilerServices
11
+ {
12
+ using System;
13
+
14
+ /// <summary>
15
+ /// Runtime checks that il2cpp.exe can omit for an annotated scope.
16
+ /// </summary>
17
+ internal enum Option
18
+ {
19
+ /// <summary>Implicit null checks before member access.</summary>
20
+ NullChecks = 1,
21
+
22
+ /// <summary>Array bounds checks on element access.</summary>
23
+ ArrayBoundsChecks = 2,
24
+
25
+ /// <summary>Integer divide-by-zero checks.</summary>
26
+ DivideByZeroChecks = 3,
27
+ }
28
+
29
+ /// <summary>
30
+ /// Instructs the IL2CPP code generator to enable or disable a runtime
31
+ /// check for the annotated type, method, or property.
32
+ /// </summary>
33
+ /// <remarks>
34
+ /// Only apply with <c>false</c> to code whose safety invariants are
35
+ /// guaranteed by construction and covered by tests: with checks disabled,
36
+ /// a violated invariant is memory corruption instead of a managed
37
+ /// exception.
38
+ /// </remarks>
39
+ [AttributeUsage(
40
+ AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property,
41
+ Inherited = false,
42
+ AllowMultiple = true
43
+ )]
44
+ internal sealed class Il2CppSetOptionAttribute : Attribute
45
+ {
46
+ public Option Option { get; private set; }
47
+
48
+ public object Value { get; private set; }
49
+
50
+ public Il2CppSetOptionAttribute(Option option, object value)
51
+ {
52
+ Option = option;
53
+ Value = value;
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 45b1a17f8c10b654c9ba5cd3e70e5f9e
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,3 +1,3 @@
1
- fileFormatVersion: 2
2
- guid: e2cb23a56cf1416ba06dccca58c8297f
1
+ fileFormatVersion: 2
2
+ guid: e2cb23a56cf1416ba06dccca58c8297f
3
3
  timeCreated: 1730779055
@@ -0,0 +1,195 @@
1
+ namespace DxMessaging.Core.Configuration
2
+ {
3
+ using System;
4
+ using MessageBus;
5
+ #if UNITY_2021_3_OR_NEWER
6
+ using UnityEngine;
7
+
8
+ /// <summary>
9
+ /// Runtime-loaded settings asset that controls memory-reclamation policy and
10
+ /// pool sizing for DxMessaging. Loaded at first bus construction via
11
+ /// <c>Resources.Load&lt;DxMessagingRuntimeSettings&gt;("DxMessagingRuntimeSettings")</c>;
12
+ /// when the asset is absent a defaulted instance is used so the package works
13
+ /// out-of-the-box.
14
+ /// </summary>
15
+ /// <remarks>
16
+ /// To customize, create the asset via <c>Assets &gt; Create &gt; Wallstop Studios &gt;
17
+ /// DxMessaging &gt; Runtime Settings</c> and place it under any
18
+ /// <c>Resources/</c> folder named <c>DxMessagingRuntimeSettings.asset</c>.
19
+ /// Field changes raise <see cref="SettingsChanged"/>; consumers should
20
+ /// re-read derived state on the event.
21
+ /// </remarks>
22
+ [CreateAssetMenu(
23
+ fileName = ResourceName,
24
+ menuName = "Wallstop Studios/DxMessaging/Runtime Settings"
25
+ )]
26
+ public sealed class DxMessagingRuntimeSettings : ScriptableObject
27
+ {
28
+ /// <summary>Resource name (no extension) used by <c>Resources.Load</c>.</summary>
29
+ public const string ResourceName = "DxMessagingRuntimeSettings";
30
+
31
+ /// <summary>Default soft cap on per-pool retained entries.</summary>
32
+ public const int DefaultBufferMaxDistinctEntries = 512;
33
+
34
+ /// <summary>Default idle threshold in seconds before an empty slot is eligible for eviction.</summary>
35
+ public const float DefaultIdleEvictionSeconds = 30f;
36
+
37
+ /// <summary>Default minimum interval between idle sweeps, in seconds.</summary>
38
+ public const float DefaultEvictionTickIntervalSeconds = 5f;
39
+
40
+ [SerializeField]
41
+ [Tooltip(
42
+ "Idle threshold in seconds. Empty per-message-type slots are evicted only after going at least this long without a register/deregister/dispatch touch. See IdleEvictionSeconds."
43
+ )]
44
+ [Min(0f)]
45
+ internal float _idleEvictionSeconds = DefaultIdleEvictionSeconds;
46
+
47
+ [SerializeField]
48
+ [Tooltip(
49
+ "Soft cap on the number of distinct entries each shared collection pool will retain. Excess entries are evicted (LRU or LIFO depending on BufferUseLruEviction)."
50
+ )]
51
+ [Min(0)]
52
+ internal int _bufferMaxDistinctEntries = DefaultBufferMaxDistinctEntries;
53
+
54
+ [SerializeField]
55
+ [Tooltip(
56
+ "When true, shared collection pools use LRU eviction; otherwise pools behave as a bounded LIFO stack. See BufferUseLruEviction."
57
+ )]
58
+ internal bool _bufferUseLruEviction = true;
59
+
60
+ [SerializeField]
61
+ [Tooltip(
62
+ "When true, IMessageBus.Trim performs its work; when false it is a no-op returning default. Lets shipped titles disable on-demand reclamation. See EnableTrimApi."
63
+ )]
64
+ internal bool _enableTrimApi = true;
65
+
66
+ [SerializeField]
67
+ [Tooltip(
68
+ "Minimum interval in seconds between idle sweeps. Emit-time idle eviction samples the clock periodically instead of at the top of every Emit, and sweeps only when this much wall time has elapsed since the last sweep. See EvictionTickIntervalSeconds."
69
+ )]
70
+ [Min(0f)]
71
+ internal float _evictionTickIntervalSeconds = DefaultEvictionTickIntervalSeconds;
72
+
73
+ [SerializeField]
74
+ [Tooltip(
75
+ "Master switch for idle-time eviction. When false neither inline emit-time sweeps nor PlayerLoop sweeps run; explicit Trim still works (gated by EnableTrimApi). See EvictionEnabled."
76
+ )]
77
+ internal bool _evictionEnabled = true;
78
+
79
+ [SerializeField]
80
+ [Tooltip(
81
+ "Diagnostic message buffer size used when the bus is constructed. Mirrors IMessageBus.DefaultMessageBufferSize so the runtime asset can override the global default without touching code. See MessageBufferSize."
82
+ )]
83
+ [Min(0)]
84
+ internal int _messageBufferSize = IMessageBus.DefaultMessageBufferSize;
85
+
86
+ private bool _isFallbackInstance;
87
+
88
+ /// <summary>Idle threshold in seconds. See <c>_idleEvictionSeconds</c>.</summary>
89
+ public float IdleEvictionSeconds => _idleEvictionSeconds;
90
+
91
+ /// <summary>Per-pool retained-entry cap. See <c>_bufferMaxDistinctEntries</c>.</summary>
92
+ public int BufferMaxDistinctEntries => _bufferMaxDistinctEntries;
93
+
94
+ /// <summary>True when shared pools use LRU eviction.</summary>
95
+ public bool BufferUseLruEviction => _bufferUseLruEviction;
96
+
97
+ /// <summary>True when explicit Trim APIs perform work.</summary>
98
+ public bool EnableTrimApi => _enableTrimApi;
99
+
100
+ /// <summary>Minimum interval between idle sweeps, in seconds.</summary>
101
+ public float EvictionTickIntervalSeconds => _evictionTickIntervalSeconds;
102
+
103
+ /// <summary>Master switch for idle-time eviction.</summary>
104
+ public bool EvictionEnabled => _evictionEnabled;
105
+
106
+ /// <summary>Diagnostic message buffer size.</summary>
107
+ public int MessageBufferSize => _messageBufferSize;
108
+
109
+ internal bool IsFallbackInstance => _isFallbackInstance;
110
+
111
+ /// <summary>
112
+ /// Raised when this asset is mutated in the editor or via test-only override.
113
+ /// Subscribers should be small and re-entrancy-safe; the event is invoked
114
+ /// synchronously from <c>OnValidate</c>.
115
+ /// </summary>
116
+ public static event Action<DxMessagingRuntimeSettings> SettingsChanged;
117
+
118
+ /// <summary>
119
+ /// Used by <see cref="DxMessagingRuntimeSettingsProvider.Override"/> to push
120
+ /// a test-supplied override and notify subscribers.
121
+ /// </summary>
122
+ internal static void RaiseSettingsChanged(DxMessagingRuntimeSettings settings)
123
+ {
124
+ SettingsChanged?.Invoke(settings);
125
+ }
126
+
127
+ internal void MarkAsFallbackInstance()
128
+ {
129
+ _isFallbackInstance = true;
130
+ }
131
+
132
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
133
+ private static void ClearSubscribersOnLoad()
134
+ {
135
+ SettingsChanged = null;
136
+ }
137
+
138
+ #if UNITY_EDITOR
139
+ private const string ResourceFolder = "Assets/Resources";
140
+ private const string ResourceAssetPath = ResourceFolder + "/" + ResourceName + ".asset";
141
+
142
+ [UnityEditor.MenuItem(
143
+ "Assets/Create/Wallstop Studios/DxMessaging/Runtime Settings (in Resources)"
144
+ )]
145
+ private static void CreateAssetInResources()
146
+ {
147
+ if (!UnityEditor.AssetDatabase.IsValidFolder(ResourceFolder))
148
+ {
149
+ UnityEditor.AssetDatabase.CreateFolder("Assets", "Resources");
150
+ }
151
+ string targetPath = UnityEditor.AssetDatabase.GenerateUniqueAssetPath(
152
+ ResourceAssetPath
153
+ );
154
+ DxMessagingRuntimeSettings asset =
155
+ ScriptableObject.CreateInstance<DxMessagingRuntimeSettings>();
156
+ UnityEditor.AssetDatabase.CreateAsset(asset, targetPath);
157
+ UnityEditor.AssetDatabase.SaveAssets();
158
+ UnityEditor.EditorGUIUtility.PingObject(asset);
159
+ }
160
+
161
+ private void OnValidate()
162
+ {
163
+ if (_idleEvictionSeconds < 0f)
164
+ {
165
+ _idleEvictionSeconds = 0f;
166
+ }
167
+ if (_bufferMaxDistinctEntries < 0)
168
+ {
169
+ _bufferMaxDistinctEntries = 0;
170
+ }
171
+ if (_evictionTickIntervalSeconds < 0f)
172
+ {
173
+ _evictionTickIntervalSeconds = 0f;
174
+ }
175
+ if (_messageBufferSize < 0)
176
+ {
177
+ _messageBufferSize = 0;
178
+ }
179
+ string assetPath = UnityEditor.AssetDatabase.GetAssetPath(this);
180
+ if (
181
+ !string.IsNullOrEmpty(assetPath)
182
+ && assetPath.IndexOf("/Resources/", StringComparison.OrdinalIgnoreCase) < 0
183
+ )
184
+ {
185
+ Debug.LogWarning(
186
+ "[DxMessaging] Runtime settings asset is not under a Resources/ folder; Resources.Load will not find it. Move it under Assets/Resources/ or use the 'Assets/Create/Wallstop Studios/DxMessaging/Runtime Settings (in Resources)' menu.",
187
+ this
188
+ );
189
+ }
190
+ RaiseSettingsChanged(this);
191
+ }
192
+ #endif
193
+ }
194
+ #endif
195
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 2f98fd11ff90d4d813cabc6bc2a77a72
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,179 @@
1
+ namespace DxMessaging.Core.Configuration
2
+ {
3
+ using System;
4
+ using System.Threading;
5
+ using MessageBus;
6
+ #if UNITY_2021_3_OR_NEWER
7
+ using UnityEngine;
8
+ #endif
9
+
10
+ #if UNITY_2021_3_OR_NEWER
11
+ /// <summary>
12
+ /// Lazy provider that hands out the active <see cref="DxMessagingRuntimeSettings"/>
13
+ /// instance. Tries <c>Resources.Load&lt;DxMessagingRuntimeSettings&gt;("DxMessagingRuntimeSettings")</c>
14
+ /// once per AppDomain; on miss, returns a defaulted in-memory instance so the
15
+ /// runtime always has a usable settings object.
16
+ /// </summary>
17
+ /// <remarks>
18
+ /// Tests inject a fake via <see cref="Override"/>, which returns an
19
+ /// <see cref="IDisposable"/> that restores the prior current settings. Override
20
+ /// raises <see cref="DxMessagingRuntimeSettings.SettingsChanged"/> on push and
21
+ /// pop so subscribed buses re-apply caps.
22
+ /// </remarks>
23
+ public static class DxMessagingRuntimeSettingsProvider
24
+ {
25
+ private static DxMessagingRuntimeSettings _cached;
26
+ private static readonly object _gate = new();
27
+
28
+ /// <summary>
29
+ /// Returns the active settings instance. Loads the asset on first call;
30
+ /// subsequent calls return the cached reference (or a test override if
31
+ /// <see cref="Override"/> is active).
32
+ /// </summary>
33
+ /// <remarks>
34
+ /// In non-Unity builds (where <c>UNITY_2021_3_OR_NEWER</c> is not defined)
35
+ /// this property returns <c>null</c> because <c>ScriptableObject</c> is
36
+ /// unavailable. Callers must tolerate a <c>null</c> result outside Unity.
37
+ /// </remarks>
38
+ public static DxMessagingRuntimeSettings Current
39
+ {
40
+ get
41
+ {
42
+ DxMessagingRuntimeSettings local = Volatile.Read(ref _cached);
43
+ if (local != null)
44
+ {
45
+ return local;
46
+ }
47
+ lock (_gate)
48
+ {
49
+ local = _cached;
50
+ if (local != null)
51
+ {
52
+ return local;
53
+ }
54
+ local = LoadOrCreate();
55
+ Volatile.Write(ref _cached, local);
56
+ return local;
57
+ }
58
+ }
59
+ }
60
+
61
+ /// <summary>
62
+ /// Pushes a test-supplied settings instance as the active <see cref="Current"/>
63
+ /// value and raises <see cref="DxMessagingRuntimeSettings.SettingsChanged"/>.
64
+ /// Disposing the returned token restores the previous instance and raises
65
+ /// the event again so subscribers re-apply the original caps.
66
+ /// </summary>
67
+ public static IDisposable Override(DxMessagingRuntimeSettings settings)
68
+ {
69
+ if (settings == null)
70
+ {
71
+ throw new ArgumentNullException(nameof(settings));
72
+ }
73
+ DxMessagingRuntimeSettings previous;
74
+ int previousGlobalMessageBufferSize = IMessageBus.GlobalMessageBufferSize;
75
+ lock (_gate)
76
+ {
77
+ previous = _cached;
78
+ _cached = settings;
79
+ }
80
+ DxMessagingRuntimeSettings.RaiseSettingsChanged(settings);
81
+ return new OverrideToken(settings, previous, previousGlobalMessageBufferSize);
82
+ }
83
+
84
+ /// <summary>
85
+ /// Clears the cached reference, forcing the next <see cref="Current"/>
86
+ /// access to reload from <c>Resources</c>. Test-only.
87
+ /// </summary>
88
+ internal static void ResetForTests()
89
+ {
90
+ lock (_gate)
91
+ {
92
+ _cached = null;
93
+ }
94
+ }
95
+
96
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
97
+ private static void OnSubsystemRegistration()
98
+ {
99
+ ResetForTests();
100
+ }
101
+
102
+ private static DxMessagingRuntimeSettings LoadOrCreate()
103
+ {
104
+ DxMessagingRuntimeSettings asset = null;
105
+ try
106
+ {
107
+ asset = Resources.Load<DxMessagingRuntimeSettings>(
108
+ DxMessagingRuntimeSettings.ResourceName
109
+ );
110
+ }
111
+ catch
112
+ {
113
+ asset = null;
114
+ }
115
+ if (asset != null)
116
+ {
117
+ return asset;
118
+ }
119
+ DxMessagingRuntimeSettings fallback =
120
+ ScriptableObject.CreateInstance<DxMessagingRuntimeSettings>();
121
+ fallback.MarkAsFallbackInstance();
122
+ fallback.hideFlags = HideFlags.HideAndDontSave;
123
+ fallback.name = DxMessagingRuntimeSettings.ResourceName + " (Default)";
124
+ return fallback;
125
+ }
126
+
127
+ private sealed class OverrideToken : IDisposable
128
+ {
129
+ private readonly DxMessagingRuntimeSettings _installed;
130
+ private readonly int _previousGlobalMessageBufferSize;
131
+ private DxMessagingRuntimeSettings _previous;
132
+ private bool _disposed;
133
+
134
+ public OverrideToken(
135
+ DxMessagingRuntimeSettings installed,
136
+ DxMessagingRuntimeSettings previous,
137
+ int previousGlobalMessageBufferSize
138
+ )
139
+ {
140
+ _installed = installed;
141
+ _previous = previous;
142
+ _previousGlobalMessageBufferSize = previousGlobalMessageBufferSize;
143
+ }
144
+
145
+ public void Dispose()
146
+ {
147
+ if (_disposed)
148
+ {
149
+ return;
150
+ }
151
+ _disposed = true;
152
+ DxMessagingRuntimeSettings restored = null;
153
+ bool didRestore = false;
154
+ lock (_gate)
155
+ {
156
+ // Only restore if our install is still the active one.
157
+ // If a deeper Override was pushed on top, this Dispose is a no-op
158
+ // so the LIFO stack is honored.
159
+ if (ReferenceEquals(_cached, _installed))
160
+ {
161
+ _cached = _previous;
162
+ restored = _previous;
163
+ didRestore = true;
164
+ }
165
+ _previous = null;
166
+ }
167
+ if (didRestore)
168
+ {
169
+ if (restored == null || restored.IsFallbackInstance)
170
+ {
171
+ IMessageBus.GlobalMessageBufferSize = _previousGlobalMessageBufferSize;
172
+ }
173
+ DxMessagingRuntimeSettings.RaiseSettingsChanged(restored);
174
+ }
175
+ }
176
+ }
177
+ }
178
+ #endif
179
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: b242396a6d286a776885179f9908a593
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,9 @@
1
+ fileFormatVersion: 2
2
+ guid: 0c5cb60b0129e6df3a4455a62ec7ffb9
3
+ timeCreated: 1777840186
4
+ folderAsset: yes
5
+ DefaultImporter:
6
+ externalObjects: {}
7
+ userData:
8
+ assetBundleName:
9
+ assetBundleVariant: