com.wallstop-studios.dxmessaging 2.0.0-rc27.3.1 → 2.0.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.
@@ -1,16 +1,79 @@
1
1
  # Mini Combat Sample
2
2
 
3
- > **What You'll Learn**: This sample demonstrates a simple combat system using DxMessaging to show how components communicate through messages. Perfect for beginners learning the messaging system!
3
+ > **Perfect for:** First-time users who want to see messaging in action with a working combat example
4
4
 
5
- ## Overview
5
+ ## What You'll Learn in 10 Minutes
6
6
 
7
- This mini-sample showcases a basic combat loop using DxMessaging with Unity-friendly APIs. You'll see how different game objects (Player, Enemy, UI) communicate without direct references to each other.
7
+ **Stop reading documentation and start seeing it work!** This sample shows:
8
8
 
9
- ### Key Concepts Demonstrated:
9
+ 1. How Player heals without UI knowing about Player (**zero coupling**)
10
+ 2. How Enemy broadcasts damage without knowing who cares (**observer pattern**)
11
+ 3. How settings changes update everything automatically (**global events**)
10
12
 
11
- - **Untargeted Messages**: Global messages anyone can listen to (like game settings)
12
- - **Targeted Messages**: Messages sent to a specific component (like healing a player)
13
- - **Broadcast Messages**: Messages announced to all listeners (like damage events)
13
+ **No prior messaging experience needed** - this sample walks you through everything.
14
+
15
+ ---
16
+
17
+ ## Why This Sample Matters
18
+
19
+ ### Before DxMessaging:
20
+
21
+ ```csharp
22
+ public class Player {
23
+ [SerializeField] private UI ui; // Coupling!
24
+ [SerializeField] private AudioManager audio; // More coupling!
25
+
26
+ void Heal(int amount) {
27
+ health += amount;
28
+ ui.UpdateHealth(health); // Manual call
29
+ audio.PlayHealSound(); // Manual call
30
+ }
31
+ }
32
+ ```
33
+
34
+ #### Every new system = another SerializeField + another manual call.
35
+
36
+ ##### With DxMessaging:
37
+
38
+ ```csharp
39
+ public class Player : MessageAwareComponent {
40
+ void Heal(int amount) {
41
+ health += amount;
42
+ new PlayerHealed(amount).EmitBroadcast(this);
43
+ // Done! UI, audio, analytics all react automatically.
44
+ }
45
+ }
46
+ ```
47
+
48
+ ###### Zero coupling. Zero manual wiring. That's the power of messaging.
49
+
50
+ ---
51
+
52
+ ## Key Concepts (3 Message Types)
53
+
54
+ ### 1. Untargeted - "Everyone, listen up!"
55
+
56
+ **Example:** Game settings changed
57
+
58
+ - Like a stadium announcement - everyone hears it
59
+ - No specific target
60
+ - Perfect for: settings, pause, scene transitions
61
+
62
+ ### 2. Targeted - "Hey YOU, do this!"
63
+
64
+ **Example:** Heal this specific player
65
+
66
+ - Like mailing a letter to one address
67
+ - Only the target receives it
68
+ - Perfect for: commands, direct actions
69
+
70
+ ### 3. Broadcast - "I did something!"
71
+
72
+ **Example:** Enemy took damage
73
+
74
+ - Like ringing a bell - anyone nearby can hear
75
+ - Source announces, observers react
76
+ - Perfect for: events, notifications, analytics
14
77
 
15
78
  ---
16
79
 
@@ -28,25 +91,22 @@ Here's what each script does:
28
91
 
29
92
  ---
30
93
 
31
- ## Quick Start Guide
94
+ ## Quick Start Guide (2 Minutes to Working Demo)
32
95
 
33
- ### Method 1: Import from Package Manager (Recommended)
96
+ ### Import & Run (Fastest Way)
34
97
 
35
- 1. **Open Package Manager**:
36
- - Window → Package Manager
98
+ #### Want to see it work immediately?
37
99
 
38
- 1. **Find DxMessaging**:
39
- - Look for "DxMessaging" in the package list
40
- - Click on it to select
100
+ 1. **Open Package Manager**: Window → Package Manager
101
+ 2. **Find DxMessaging** in the package list
102
+ 3. **Scroll to Samples** section → Find "Mini Combat" → Click **Import**
103
+ 4. **Navigate to** Assets/Samples/DxMessaging/.../Mini Combat/
104
+ 5. **Open the scene**
105
+ 6. **Press Play** 🎮
41
106
 
42
- 1. **Import the Sample**:
43
- - In the Package Manager details view, scroll down to find the "Samples" section
44
- - Find "Mini Combat" and click **Import**
45
- - The sample files will be imported into your Assets/Samples folder
107
+ **That's it!** Watch the Console logs as messages flow.
46
108
 
47
- 1. **Open the Scene**:
48
- - Navigate to Assets/Samples/DxMessaging/.../Mini Combat/
49
- - Open the sample scene or create a new scene and follow Step 1 below
109
+ **Pro tip:** Enable diagnostics in the Inspector (MessagingComponent → Enable Diagnostics) to see message traffic in real-time.
50
110
 
51
111
  ### Method 2: Manual Setup in Your Scene
52
112
 
@@ -1,6 +1,28 @@
1
1
  # Mini Combat Walkthrough
2
2
 
3
- > **Deep Dive**: This walkthrough explains the implementation details and shows how all the sample scripts work together at runtime. Great for understanding the "why" behind the code!
3
+ > **Deep Dive**: Ready to understand HOW it works? This walkthrough explains every line of code and shows the complete message flow.
4
+
5
+ ## Who This Is For
6
+
7
+ - ✅ **You've imported and run the sample** - now you want to understand it
8
+ - ✅ **You want to build your own** - need to see the patterns in action
9
+ - ✅ **You're debugging something** - need to understand the flow
10
+
11
+ **Haven't run the sample yet?** Go back to [the sample README](README.md) and press Play first. Come back when you've seen it work.
12
+
13
+ ---
14
+
15
+ ## What You'll Understand By The End
16
+
17
+ After reading this walkthrough, you'll know:
18
+
19
+ 1. **Why each message type was chosen** - the reasoning behind Untargeted vs Targeted vs Broadcast
20
+ 2. **How the code flows** - step-by-step from Boot.cs through every script
21
+ 3. **Common patterns** - Observer, Broadcaster, Orchestrator, and more
22
+ 4. **Debugging strategies** - how to find and fix issues
23
+ 5. **How to extend it** - add your own messages and handlers
24
+
25
+ **Estimated time:** 20-30 minutes for thorough understanding
4
26
 
5
27
  ---
6
28
 
@@ -1,21 +1,64 @@
1
- # UI Buttons + Inspector (Sample)
1
+ # UI Buttons + Inspector Sample
2
2
 
3
- Make a Unity UI Button send a message with a single OnClick hook — no plumbing, no scene-wide singletons, and easy to understand even if you’re new to event systems.
3
+ > **Perfect for:** Seeing DxMessaging work with Unity UI in 60 seconds
4
4
 
5
- ## What Youll Learn
5
+ ## What You'll Learn (No Code Required!)
6
6
 
7
- - How to wire a UI Button to emit a DxMessaging message from the Inspector.
8
- - How to observe messages in the Console with a tiny listener component.
9
- - How to turn on diagnostics to see message traffic while you click.
7
+ **Stop writing button click handlers!** This sample shows you how to:
10
8
 
11
- ## Import The Sample (60 seconds)
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
12
 
13
- 1. Open `Window > Package Manager` in Unity.
14
- 1. Select `com.wallstop-studios.dxmessaging`.
15
- 1. In Samples, import “UI Buttons + Inspector”.
16
- 1. Open the sample scene (created under your project’s `Assets/Samples/...`).
13
+ **Why this matters:** You can add new systems (analytics, audio, achievements) that react to button clicks WITHOUT touching existing code.
17
14
 
18
- That’s it — the scene includes everything you need to click and see messages.
15
+ ---
16
+
17
+ ## The Power Move
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. Zero coupling.
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
+ **Done!** You're seeing DxMessaging in action.
19
62
 
20
63
  ## Click-To-Message: The Quick Path
21
64
 
@@ -39,7 +39,7 @@ namespace DxMessaging.Tests.Runtime.Core
39
39
  public readonly string c;
40
40
 
41
41
  [DxOptionalParameter(Expression = "null")]
42
- public readonly string? d;
42
+ public readonly string d;
43
43
  }
44
44
  }
45
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.wallstop-studios.dxmessaging",
3
- "version": "2.0.0-rc27.3.1",
3
+ "version": "2.0.0",
4
4
  "displayName": "DxMessaging",
5
5
  "description": "Synchronous Event Bus for Unity",
6
6
  "unity": "2021.3",