com.wallstop-studios.dxmessaging 2.0.0-rc11 → 2.0.0-rc13

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 (107) hide show
  1. package/.gitattributes +63 -63
  2. package/.github/workflows/npm-publish.yml +66 -0
  3. package/CHANGELOG.md.meta +7 -7
  4. package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +33 -33
  5. package/Editor/Analyzers/Microsoft.CodeAnalysis.dll.meta +33 -33
  6. package/Editor/Analyzers/System.Reflection.Metadata.dll.meta +33 -33
  7. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +71 -71
  8. package/Editor/Analyzers.meta +8 -8
  9. package/Editor/SetupCscRsp.cs +162 -146
  10. package/Editor/SetupCscRsp.cs.meta +2 -2
  11. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef +17 -17
  12. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef.meta +7 -7
  13. package/Editor.meta +8 -8
  14. package/LICENSE.md +6 -6
  15. package/LICENSE.md.meta +7 -7
  16. package/README.md +387 -363
  17. package/README.md.meta +7 -7
  18. package/Runtime/Core/Attributes/DxAutoMessageTypeAttribute.cs +7 -9
  19. package/Runtime/Core/Attributes/DxAutoMessageTypeAttribute.cs.meta +2 -2
  20. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs +7 -10
  21. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs.meta +2 -2
  22. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs +7 -10
  23. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs.meta +2 -2
  24. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs +7 -10
  25. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs.meta +2 -2
  26. package/Runtime/Core/Attributes.meta +2 -2
  27. package/Runtime/Core/Extensions/MessageExtensions.cs +342 -275
  28. package/Runtime/Core/Extensions/MessageExtensions.cs.meta +11 -11
  29. package/Runtime/Core/Extensions.meta +8 -8
  30. package/Runtime/Core/IMessage.cs +12 -12
  31. package/Runtime/Core/IMessage.cs.meta +11 -11
  32. package/Runtime/Core/InstanceId.cs +149 -149
  33. package/Runtime/Core/InstanceId.cs.meta +11 -11
  34. package/Runtime/Core/MessageBus/IMessageBus.cs +309 -309
  35. package/Runtime/Core/MessageBus/IMessageBus.cs.meta +11 -11
  36. package/Runtime/Core/MessageBus/MessageBus.cs +2243 -2084
  37. package/Runtime/Core/MessageBus/MessageBus.cs.meta +11 -11
  38. package/Runtime/Core/MessageBus/MessagingRegistration.cs +105 -100
  39. package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +11 -11
  40. package/Runtime/Core/MessageBus/RegistrationLog.cs +111 -111
  41. package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +11 -11
  42. package/Runtime/Core/MessageBus.meta +8 -8
  43. package/Runtime/Core/MessageHandler.cs +2778 -2759
  44. package/Runtime/Core/MessageHandler.cs.meta +11 -11
  45. package/Runtime/Core/MessageRegistrationHandle.cs +110 -110
  46. package/Runtime/Core/MessageRegistrationHandle.cs.meta +11 -11
  47. package/Runtime/Core/MessageRegistrationToken.cs +1234 -1234
  48. package/Runtime/Core/MessageRegistrationToken.cs.meta +11 -11
  49. package/Runtime/Core/Messages/IBroadcastMessage.cs +27 -27
  50. package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +11 -11
  51. package/Runtime/Core/Messages/ITargetedMessage.cs +27 -26
  52. package/Runtime/Core/Messages/ITargetedMessage.cs.meta +11 -11
  53. package/Runtime/Core/Messages/IUntargetedMessage.cs +27 -26
  54. package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +11 -11
  55. package/Runtime/Core/Messages.meta +8 -8
  56. package/Runtime/Core/MessagingDebug.cs +70 -71
  57. package/Runtime/Core/MessagingDebug.cs.meta +11 -11
  58. package/Runtime/Core.meta +8 -8
  59. package/Runtime/Unity/MessageAwareComponent.cs +77 -77
  60. package/Runtime/Unity/MessageAwareComponent.cs.meta +11 -11
  61. package/Runtime/Unity/MessagingComponent.cs +99 -99
  62. package/Runtime/Unity/MessagingComponent.cs.meta +11 -11
  63. package/Runtime/Unity.meta +8 -8
  64. package/Runtime/WallstopStudios.DxMessaging.asmdef +15 -15
  65. package/Runtime.meta +8 -8
  66. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoMessageTypeGenerator.cs +92 -75
  67. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoMessageTypeGenerator.cs.meta +11 -11
  68. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxBroadcastMessageGenerator.cs +94 -77
  69. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxBroadcastMessageGenerator.cs.meta +2 -2
  70. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxTargetedMessageGenerator.cs +94 -77
  71. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxTargetedMessageGenerator.cs.meta +2 -2
  72. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxUntargetedMessageGenerator.cs +94 -78
  73. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxUntargetedMessageGenerator.cs.meta +2 -2
  74. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj +21 -21
  75. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj.meta +7 -7
  76. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.meta +8 -8
  77. package/SourceGenerators.meta +8 -8
  78. package/Tests/Runtime/Benchmarks/PerformanceTests.cs +373 -310
  79. package/Tests/Runtime/Benchmarks/PerformanceTests.cs.meta +11 -11
  80. package/Tests/Runtime/Benchmarks.meta +8 -8
  81. package/Tests/Runtime/Core/BroadcastTests.cs +899 -899
  82. package/Tests/Runtime/Core/GlobalAcceptAllTests.cs +190 -169
  83. package/Tests/Runtime/Core/GlobalAcceptAllTests.cs.meta +11 -11
  84. package/Tests/Runtime/Core/MessagingTestBase.cs +185 -164
  85. package/Tests/Runtime/Core/MessagingTestBase.cs.meta +11 -11
  86. package/Tests/Runtime/Core/NominalTests.cs +1740 -1518
  87. package/Tests/Runtime/Core/PostProcessorTests.cs +1236 -849
  88. package/Tests/Runtime/Core/PostProcessorTests.cs.meta +11 -11
  89. package/Tests/Runtime/Core/RegistrationTests.cs +1266 -995
  90. package/Tests/Runtime/Core/RegistrationTests.cs.meta +11 -11
  91. package/Tests/Runtime/Core/TargetedTests.cs +888 -888
  92. package/Tests/Runtime/Core/TargetedTests.cs.meta +11 -11
  93. package/Tests/Runtime/Core/UntargetedTests.cs +272 -272
  94. package/Tests/Runtime/Core/UntargetedTests.cs.meta +11 -11
  95. package/Tests/Runtime/Scripts/Components/EmptyMessageAwareComponent.cs +9 -9
  96. package/Tests/Runtime/Scripts/Components/EmptyMessageAwareComponent.cs.meta +11 -11
  97. package/Tests/Runtime/Scripts/Components/SimpleMessageAwareComponent.cs +186 -140
  98. package/Tests/Runtime/Scripts/Messages/ComplexTargetedMessage.cs +30 -30
  99. package/Tests/Runtime/Scripts/Messages/SimpleBroadcastMessage.cs +8 -8
  100. package/Tests/Runtime/Scripts/Messages/SimpleTargetedMessage.cs +8 -8
  101. package/Tests/Runtime/Scripts/Messages/SimpleUntargetedMessage.cs +8 -8
  102. package/Tests/Runtime/WallstopStudios.DxMessaging.Tests.Runtime.asmdef +22 -22
  103. package/Tests/Runtime/WallstopStudios.DxMessaging.Tests.Runtime.csproj.meta +7 -7
  104. package/Tests.meta +8 -8
  105. package/Third Party Notices.md.meta +7 -7
  106. package/package.json +36 -36
  107. package/package.json.meta +7 -7
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: d5dce65290c6c424b870b19b6353e6b1
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: d5dce65290c6c424b870b19b6353e6b1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,27 +1,27 @@
1
- namespace DxMessaging.Core.Messages
2
- {
3
- using System;
4
-
5
- /// <summary>
6
- /// Message from a specific entity but for any listener.
7
- /// </summary>
8
- /// <note>
9
- /// BroadcastMessages should be thought of as reactionary. Things like "EntityX has died", "EntityX has picked up ItemZ",
10
- /// or "EntityX has lost 1 health".
11
- /// Inheritance should be completely flat. Ie, IBroadcastMessage should be the direct parent of every implementer.
12
- /// </note>
13
- public interface IBroadcastMessage : IMessage { }
14
-
15
- /// <summary>
16
- /// No-alloc BroadcastMessages. Derive from this type to not have your messages boxed (if they are structs).
17
- /// <code>
18
- /// public readonly MyCoolStruct : IBroadCastMessage{MyCoolStruct}
19
- /// </code>
20
- /// </summary>
21
- /// <typeparam name="T">Concrete type of the derived. Should be the derived type and nothing else.</typeparam>
22
- public interface IBroadcastMessage<T> : IBroadcastMessage where T: IBroadcastMessage
23
- {
24
- Type IMessage.MessageType => typeof(T);
25
- }
26
-
27
- }
1
+ namespace DxMessaging.Core.Messages
2
+ {
3
+ using System;
4
+
5
+ /// <summary>
6
+ /// Message from a specific entity but for any listener.
7
+ /// </summary>
8
+ /// <note>
9
+ /// BroadcastMessages should be thought of as reactionary. Things like "EntityX has died", "EntityX has picked up ItemZ",
10
+ /// or "EntityX has lost 1 health".
11
+ /// Inheritance should be completely flat. Ie, IBroadcastMessage should be the direct parent of every implementer.
12
+ /// </note>
13
+ public interface IBroadcastMessage : IMessage { }
14
+
15
+ /// <summary>
16
+ /// No-alloc BroadcastMessages. Derive from this type to not have your messages boxed (if they are structs).
17
+ /// <code>
18
+ /// public readonly MyCoolStruct : IBroadCastMessage{MyCoolStruct}
19
+ /// </code>
20
+ /// </summary>
21
+ /// <typeparam name="T">Concrete type of the derived. Should be the derived type and nothing else.</typeparam>
22
+ public interface IBroadcastMessage<T> : IBroadcastMessage
23
+ where T : IBroadcastMessage
24
+ {
25
+ Type IMessage.MessageType => typeof(T);
26
+ }
27
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: ef4b123d67e3bcd4a8ebe2f18b3acbf9
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: ef4b123d67e3bcd4a8ebe2f18b3acbf9
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,26 +1,27 @@
1
- namespace DxMessaging.Core.Messages
2
- {
3
- using System;
4
-
5
- /// <summary>
6
- /// Used to specify general-purposes messages that are meant to be sent to a specific entity.
7
- /// </summary>
8
- /// <note>
9
- /// TargetedMessages should be thought of as commands. Things like "EntityX, pick up this rock" or
10
- /// "EntityX, you successfully completed an active reload".
11
- /// Inheritance should be completely flat. Ie, TargetedMessages should be the direct parent of every implementer.
12
- /// </note>
13
- public interface ITargetedMessage : IMessage { }
14
-
15
- /// <summary>
16
- /// No-alloc TargetedMessages. Derive from this type to not have your messages boxed (if they are structs).
17
- /// <code>
18
- /// public readonly MyCoolStruct : ITargetedMessage{MyCoolStruct}
19
- /// </code>
20
- /// </summary>
21
- /// <typeparam name="T">Concrete type of the derived. Should be the derived type and nothing else.</typeparam>
22
- public interface ITargetedMessage<T> : ITargetedMessage where T: ITargetedMessage
23
- {
24
- Type IMessage.MessageType => typeof(T);
25
- }
26
- }
1
+ namespace DxMessaging.Core.Messages
2
+ {
3
+ using System;
4
+
5
+ /// <summary>
6
+ /// Used to specify general-purposes messages that are meant to be sent to a specific entity.
7
+ /// </summary>
8
+ /// <note>
9
+ /// TargetedMessages should be thought of as commands. Things like "EntityX, pick up this rock" or
10
+ /// "EntityX, you successfully completed an active reload".
11
+ /// Inheritance should be completely flat. Ie, TargetedMessages should be the direct parent of every implementer.
12
+ /// </note>
13
+ public interface ITargetedMessage : IMessage { }
14
+
15
+ /// <summary>
16
+ /// No-alloc TargetedMessages. Derive from this type to not have your messages boxed (if they are structs).
17
+ /// <code>
18
+ /// public readonly MyCoolStruct : ITargetedMessage{MyCoolStruct}
19
+ /// </code>
20
+ /// </summary>
21
+ /// <typeparam name="T">Concrete type of the derived. Should be the derived type and nothing else.</typeparam>
22
+ public interface ITargetedMessage<T> : ITargetedMessage
23
+ where T : ITargetedMessage
24
+ {
25
+ Type IMessage.MessageType => typeof(T);
26
+ }
27
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 5b82bbdd13cb3654aafba14e0c21ca52
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: 5b82bbdd13cb3654aafba14e0c21ca52
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,26 +1,27 @@
1
- namespace DxMessaging.Core.Messages
2
- {
3
- using System;
4
-
5
- /// <summary>
6
- /// Used to specify general-purposes messages that aren't meant to be sent to specific entity.
7
- /// </summary>
8
- /// <note>
9
- /// UntargetedMessages should be thought of as game-wide, global information. Things like
10
- /// "The world has been regenerated." or "The video settings have been updated to this resolution".
11
- /// Inheritance should be completely flat. Ie, UntargetedMessages should be the direct parent of every implementer.
12
- /// </note>
13
- public interface IUntargetedMessage : IMessage { }
14
-
15
- /// <summary>
16
- /// No-alloc UntargetedMessages. Derive from this type to not have your messages boxed (if they are structs).
17
- /// <code>
18
- /// public readonly MyCoolStruct : IUntargetedMessage{MyCoolStruct}
19
- /// </code>
20
- /// </summary>
21
- /// <typeparam name="T">Concrete type of the derived. Should be the derived type and nothing else.</typeparam>
22
- public interface IUntargetedMessage<T> : IUntargetedMessage where T : IUntargetedMessage
23
- {
24
- Type IMessage.MessageType => typeof(T);
25
- }
26
- }
1
+ namespace DxMessaging.Core.Messages
2
+ {
3
+ using System;
4
+
5
+ /// <summary>
6
+ /// Used to specify general-purposes messages that aren't meant to be sent to specific entity.
7
+ /// </summary>
8
+ /// <note>
9
+ /// UntargetedMessages should be thought of as game-wide, global information. Things like
10
+ /// "The world has been regenerated." or "The video settings have been updated to this resolution".
11
+ /// Inheritance should be completely flat. Ie, UntargetedMessages should be the direct parent of every implementer.
12
+ /// </note>
13
+ public interface IUntargetedMessage : IMessage { }
14
+
15
+ /// <summary>
16
+ /// No-alloc UntargetedMessages. Derive from this type to not have your messages boxed (if they are structs).
17
+ /// <code>
18
+ /// public readonly MyCoolStruct : IUntargetedMessage{MyCoolStruct}
19
+ /// </code>
20
+ /// </summary>
21
+ /// <typeparam name="T">Concrete type of the derived. Should be the derived type and nothing else.</typeparam>
22
+ public interface IUntargetedMessage<T> : IUntargetedMessage
23
+ where T : IUntargetedMessage
24
+ {
25
+ Type IMessage.MessageType => typeof(T);
26
+ }
27
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 0a0789976ef004e4c926d5f25bd92e50
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: 0a0789976ef004e4c926d5f25bd92e50
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: eb7aa358315732945a9f45ad92904b2f
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: eb7aa358315732945a9f45ad92904b2f
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,71 +1,70 @@
1
- namespace DxMessaging.Core
2
- {
3
- using System;
4
-
5
- /// <summary>
6
- /// Severity of the log message
7
- /// </summary>
8
- public enum LogLevel
9
- {
10
- Debug = 0,
11
- Info = 1,
12
- Warn = 2,
13
- Error = 3,
14
- }
15
-
16
- /// <summary>
17
- /// Debug functionality for all of the Messaging Components.
18
- /// </summary>
19
- public static class MessagingDebug
20
- {
21
-
22
- /// <summary>
23
- /// Custom log function to use.
24
- /// </summary>
25
- /// <note>
26
- /// For Unity, you could do LogFunction = Debug.Log;
27
- /// </note>
28
- public static Action<LogLevel, string> LogFunction = null;
29
-
30
- /// <summary>
31
- /// Logs a message to the debug log function, if it's not null.
32
- /// </summary>
33
- /// <param name="logLevel">Severity of the message.</param>
34
- /// <param name="message">Message to log.</param>
35
- public static void Log(LogLevel logLevel, string message)
36
- {
37
- LogFunction?.Invoke(logLevel, message);
38
- }
39
-
40
- /// <summary>
41
- /// Logs a format string + args to the debug log function, if it's not null.
42
- /// </summary>
43
- /// <note>
44
- /// Will call string.Format(message, args)
45
- /// </note>
46
- /// <param name="logLevel">Severity of the message.</param>
47
- /// <param name="message">Format string.</param>
48
- /// <param name="args">Args to populate format string with.</param>
49
- public static void Log(LogLevel logLevel, string message, params object[] args)
50
- {
51
- Action<LogLevel, string> logFunction = LogFunction;
52
- /*
53
- We can potentially avoid an unnecessary string.Format call if the LogFunction is null,
54
- which is why the null check is outside the InternalLog function.
55
- */
56
- if (logFunction == null)
57
- {
58
- return;
59
- }
60
-
61
- if (args.Length <= 0)
62
- {
63
- logFunction.Invoke(logLevel, message);
64
- }
65
- else
66
- {
67
- logFunction.Invoke(logLevel, string.Format(message, args));
68
- }
69
- }
70
- }
71
- }
1
+ namespace DxMessaging.Core
2
+ {
3
+ using System;
4
+
5
+ /// <summary>
6
+ /// Severity of the log message
7
+ /// </summary>
8
+ public enum LogLevel
9
+ {
10
+ Debug = 0,
11
+ Info = 1,
12
+ Warn = 2,
13
+ Error = 3,
14
+ }
15
+
16
+ /// <summary>
17
+ /// Debug functionality for all of the Messaging Components.
18
+ /// </summary>
19
+ public static class MessagingDebug
20
+ {
21
+ /// <summary>
22
+ /// Custom log function to use.
23
+ /// </summary>
24
+ /// <note>
25
+ /// For Unity, you could do LogFunction = Debug.Log;
26
+ /// </note>
27
+ public static Action<LogLevel, string> LogFunction = null;
28
+
29
+ /// <summary>
30
+ /// Logs a message to the debug log function, if it's not null.
31
+ /// </summary>
32
+ /// <param name="logLevel">Severity of the message.</param>
33
+ /// <param name="message">Message to log.</param>
34
+ public static void Log(LogLevel logLevel, string message)
35
+ {
36
+ LogFunction?.Invoke(logLevel, message);
37
+ }
38
+
39
+ /// <summary>
40
+ /// Logs a format string + args to the debug log function, if it's not null.
41
+ /// </summary>
42
+ /// <note>
43
+ /// Will call string.Format(message, args)
44
+ /// </note>
45
+ /// <param name="logLevel">Severity of the message.</param>
46
+ /// <param name="message">Format string.</param>
47
+ /// <param name="args">Args to populate format string with.</param>
48
+ public static void Log(LogLevel logLevel, string message, params object[] args)
49
+ {
50
+ Action<LogLevel, string> logFunction = LogFunction;
51
+ /*
52
+ We can potentially avoid an unnecessary string.Format call if the LogFunction is null,
53
+ which is why the null check is outside the InternalLog function.
54
+ */
55
+ if (logFunction == null)
56
+ {
57
+ return;
58
+ }
59
+
60
+ if (args.Length <= 0)
61
+ {
62
+ logFunction.Invoke(logLevel, message);
63
+ }
64
+ else
65
+ {
66
+ logFunction.Invoke(logLevel, string.Format(message, args));
67
+ }
68
+ }
69
+ }
70
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 95f160b63321b69489108cdf413b55d2
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: 95f160b63321b69489108cdf413b55d2
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Runtime/Core.meta CHANGED
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: b58cce05d4f7d9447a63e82e2169f927
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: b58cce05d4f7d9447a63e82e2169f927
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,77 +1,77 @@
1
- namespace DxMessaging.Unity
2
- {
3
- using Core;
4
- using UnityEngine;
5
-
6
- [RequireComponent(typeof(MessagingComponent))]
7
- public abstract class MessageAwareComponent : MonoBehaviour
8
- {
9
- protected MessageRegistrationToken _messageRegistrationToken;
10
-
11
- /// <summary>
12
- /// If true, will register/un-register handles when the component is enabled or disabled.
13
- /// </summary>
14
- protected virtual bool MessageRegistrationTiedToEnableStatus => true;
15
-
16
- protected bool _isQuitting;
17
-
18
- protected virtual void Awake()
19
- {
20
- SetupMessageHandlers();
21
- }
22
-
23
- protected void SetupMessageHandlers()
24
- {
25
- if (_messageRegistrationToken == null)
26
- {
27
- MessagingComponent messenger = GetComponent<MessagingComponent>();
28
- _messageRegistrationToken = messenger.Create(this);
29
- }
30
-
31
- RegisterMessageHandlers();
32
- _messageRegistrationToken.Enable();
33
- }
34
-
35
- protected virtual void RegisterMessageHandlers()
36
- {
37
- // No-op, expectation is that implementations implement their own logic here
38
- }
39
-
40
- protected virtual void OnEnable()
41
- {
42
- if (MessageRegistrationTiedToEnableStatus)
43
- {
44
- _messageRegistrationToken?.Enable();
45
- }
46
- }
47
-
48
- protected virtual void OnDisable()
49
- {
50
- if (_isQuitting)
51
- {
52
- return;
53
- }
54
-
55
- if (MessageRegistrationTiedToEnableStatus)
56
- {
57
- _messageRegistrationToken?.Disable();
58
- }
59
- }
60
-
61
- protected virtual void OnDestroy()
62
- {
63
- if (_isQuitting)
64
- {
65
- return;
66
- }
67
-
68
- _messageRegistrationToken?.Disable();
69
- _messageRegistrationToken = null;
70
- }
71
-
72
- protected virtual void OnApplicationQuit()
73
- {
74
- _isQuitting = true;
75
- }
76
- }
77
- }
1
+ namespace DxMessaging.Unity
2
+ {
3
+ using Core;
4
+ using UnityEngine;
5
+
6
+ [RequireComponent(typeof(MessagingComponent))]
7
+ public abstract class MessageAwareComponent : MonoBehaviour
8
+ {
9
+ protected MessageRegistrationToken _messageRegistrationToken;
10
+
11
+ /// <summary>
12
+ /// If true, will register/un-register handles when the component is enabled or disabled.
13
+ /// </summary>
14
+ protected virtual bool MessageRegistrationTiedToEnableStatus => true;
15
+
16
+ protected bool _isQuitting;
17
+
18
+ protected virtual void Awake()
19
+ {
20
+ SetupMessageHandlers();
21
+ }
22
+
23
+ protected void SetupMessageHandlers()
24
+ {
25
+ if (_messageRegistrationToken == null)
26
+ {
27
+ MessagingComponent messenger = GetComponent<MessagingComponent>();
28
+ _messageRegistrationToken = messenger.Create(this);
29
+ }
30
+
31
+ RegisterMessageHandlers();
32
+ _messageRegistrationToken.Enable();
33
+ }
34
+
35
+ protected virtual void RegisterMessageHandlers()
36
+ {
37
+ // No-op, expectation is that implementations implement their own logic here
38
+ }
39
+
40
+ protected virtual void OnEnable()
41
+ {
42
+ if (MessageRegistrationTiedToEnableStatus)
43
+ {
44
+ _messageRegistrationToken?.Enable();
45
+ }
46
+ }
47
+
48
+ protected virtual void OnDisable()
49
+ {
50
+ if (_isQuitting)
51
+ {
52
+ return;
53
+ }
54
+
55
+ if (MessageRegistrationTiedToEnableStatus)
56
+ {
57
+ _messageRegistrationToken?.Disable();
58
+ }
59
+ }
60
+
61
+ protected virtual void OnDestroy()
62
+ {
63
+ if (_isQuitting)
64
+ {
65
+ return;
66
+ }
67
+
68
+ _messageRegistrationToken?.Disable();
69
+ _messageRegistrationToken = null;
70
+ }
71
+
72
+ protected virtual void OnApplicationQuit()
73
+ {
74
+ _isQuitting = true;
75
+ }
76
+ }
77
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: f0743aa54f7a37f4c985cf9b55f68279
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: f0743aa54f7a37f4c985cf9b55f68279
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: