From 52446824281220251e484ecb7ee7c4f1aec3869c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:33:14 +0000 Subject: [PATCH 1/3] Initial plan From 2e4fc40369a633b4bf6d8167d2f5d8e8dd05f9b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:39:18 +0000 Subject: [PATCH 2/3] Add Cysharp/R3 package dependency and ReactiveProperty demo Co-authored-by: SamuelAsherRivello <63511769+SamuelAsherRivello@users.noreply.github.com> --- .../RMC/[MyProject]/Scenes/Scene01_Intro.cs | 22 +++++++++++++++++++ Unity/Packages/manifest.json | 1 + 2 files changed, 23 insertions(+) diff --git a/Unity/Assets/Scripts/Runtime/RMC/[MyProject]/Scenes/Scene01_Intro.cs b/Unity/Assets/Scripts/Runtime/RMC/[MyProject]/Scenes/Scene01_Intro.cs index 9d1220a..acb915b 100644 --- a/Unity/Assets/Scripts/Runtime/RMC/[MyProject]/Scenes/Scene01_Intro.cs +++ b/Unity/Assets/Scripts/Runtime/RMC/[MyProject]/Scenes/Scene01_Intro.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using R3; using RMC.Audio; using RMC.MyProject.UI; using UnityEngine; @@ -33,6 +34,9 @@ public int Score { _score = value; HudUI.ScoreLabel.text = $"Score: {_score:000}/{ScoreMax:000}"; + + // R3 ReactiveProperty Demo: Update reactive score + _reactiveScore.Value = _score; } } @@ -113,6 +117,9 @@ private set private const string PlayerJumpAudioClip = "ItemUpdate01"; private const string PlayerMoveAudioClip = "Click01"; + // R3 Reactive Property Demo + private ReactiveProperty _reactiveScore = new ReactiveProperty(0); + // Unity Methods --------------------------------- /// @@ -122,6 +129,12 @@ protected void Start() { Debug.Log($"{GetType().Name}.Start()"); + // R3 ReactiveProperty Demo: Subscribe to reactive score changes + _reactiveScore.Subscribe(score => + { + Debug.Log($"[R3 Demo] Reactive Score changed to: {score}"); + }); + // Input _movePlayerInputAction = InputSystem.actions.FindAction("MovePlayer"); _jumpPlayerInputAction = InputSystem.actions.FindAction("JumpPlayer"); @@ -321,6 +334,15 @@ private void PlayAudioClip(string audioClipName) { AudioManager.Instance.PlayAudioClip(audioClipName); } + + /// + /// Clean up resources when the GameObject is destroyed + /// + protected void OnDestroy() + { + // R3 ReactiveProperty Demo: Dispose of reactive property + _reactiveScore?.Dispose(); + } // Event Handlers -------------------------------- diff --git a/Unity/Packages/manifest.json b/Unity/Packages/manifest.json index 07cc287..9016856 100644 --- a/Unity/Packages/manifest.json +++ b/Unity/Packages/manifest.json @@ -1,5 +1,6 @@ { "dependencies": { + "com.cysharp.r3": "https://github.com/Cysharp/R3.git?path=src/R3.Unity/Assets/R3.Unity", "com.rmc.rmc-audio": "1.8.4", "com.rmc.rmc-core": "1.9.5", "com.rmc.rmc-readme": "1.2.2", From 80f9dd68cf97337aa12edc478150091c30ecc759 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:42:02 +0000 Subject: [PATCH 3/3] Update assembly definition to reference R3.Unity package Co-authored-by: SamuelAsherRivello <63511769+SamuelAsherRivello@users.noreply.github.com> --- Unity/Assets/Scripts/Runtime/RMC.MyProject.Runtime.asmdef | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Unity/Assets/Scripts/Runtime/RMC.MyProject.Runtime.asmdef b/Unity/Assets/Scripts/Runtime/RMC.MyProject.Runtime.asmdef index 216cfc5..a9c19cf 100644 --- a/Unity/Assets/Scripts/Runtime/RMC.MyProject.Runtime.asmdef +++ b/Unity/Assets/Scripts/Runtime/RMC.MyProject.Runtime.asmdef @@ -4,7 +4,8 @@ "references": [ "GUID:75469ad4d38634e559750d17036d5f7c", "GUID:8d0b5587a0a8ae741afbfe3a79c2872a", - "GUID:9f522e882e6bd48429f616f259fa6318" + "GUID:9f522e882e6bd48429f616f259fa6318", + "R3.Unity" ], "includePlatforms": [], "excludePlatforms": [],