From cc9e0372f5c5496f6cdf82f2cb35a42ad79a9031 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 Aug 2025 19:04:45 +0000 Subject: [PATCH 1/3] Initial plan From c53e529c9c5c5a83d243cb3983032977f3f6b4f9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 Aug 2025 19:09:29 +0000 Subject: [PATCH 2/3] Add Cysharp/R3 package and ReactiveProperty demonstration Co-authored-by: SamuelAsherRivello <63511769+SamuelAsherRivello@users.noreply.github.com> --- .../RMC/[MyProject]/Scenes/Scene01_Intro.cs | 17 +++++++++++++---- Unity/Packages/manifest.json | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) 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..255de44 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 Cysharp.R3; using RMC.Audio; using RMC.MyProject.UI; using UnityEngine; @@ -27,12 +28,12 @@ public int Score { get { - return _score; + return _reactiveScore.Value; } set { - _score = value; - HudUI.ScoreLabel.text = $"Score: {_score:000}/{ScoreMax:000}"; + _reactiveScore.Value = value; + HudUI.ScoreLabel.text = $"Score: {_reactiveScore.Value:000}/{ScoreMax:000}"; } } @@ -102,11 +103,13 @@ private set private InputAction _toggleThemeInputAction; // Data - private int _score = 0; private int _lives = 0; private bool _isEnabledInput = true; private bool _isPlayerGrounded = false; + // R3 ReactiveProperty demonstration + private readonly ReactiveProperty _reactiveScore = new ReactiveProperty(0); + // Audio private const string PlayerResetAudioClip = "ItemRead01"; private const string GameWinAudioClip = "Music_Win01"; @@ -122,6 +125,12 @@ protected void Start() { Debug.Log($"{GetType().Name}.Start()"); + // R3 ReactiveProperty demonstration - Subscribe to score changes + _reactiveScore.Subscribe(newScore => + { + Debug.Log($"[R3 Demo] Score changed to: {newScore}"); + }).AddTo(this); + // Input _movePlayerInputAction = InputSystem.actions.FindAction("MovePlayer"); _jumpPlayerInputAction = InputSystem.actions.FindAction("JumpPlayer"); diff --git a/Unity/Packages/manifest.json b/Unity/Packages/manifest.json index 07cc287..42a4086 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", "com.rmc.rmc-audio": "1.8.4", "com.rmc.rmc-core": "1.9.5", "com.rmc.rmc-readme": "1.2.2", From 1081ea7ca98aa02aa194ae0f92be827782b5e802 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 Aug 2025 19:15:26 +0000 Subject: [PATCH 3/3] Fix R3 namespace and complete Unity package integration Co-authored-by: SamuelAsherRivello <63511769+SamuelAsherRivello@users.noreply.github.com> --- .../Scripts/Runtime/RMC/[MyProject]/Scenes/Scene01_Intro.cs | 2 +- Unity/Packages/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 255de44..6993a33 100644 --- a/Unity/Assets/Scripts/Runtime/RMC/[MyProject]/Scenes/Scene01_Intro.cs +++ b/Unity/Assets/Scripts/Runtime/RMC/[MyProject]/Scenes/Scene01_Intro.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using Cysharp.R3; +using R3; using RMC.Audio; using RMC.MyProject.UI; using UnityEngine; diff --git a/Unity/Packages/manifest.json b/Unity/Packages/manifest.json index 42a4086..9016856 100644 --- a/Unity/Packages/manifest.json +++ b/Unity/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.cysharp.r3": "https://github.com/Cysharp/R3.git", + "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",