diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs index 9b6a45f0..d7e2ebf2 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs @@ -41,6 +41,7 @@ public class CornManager : MonoBehaviour cornArray = new Corn[cornSpawnCount]; result.AddTo(this); cornGrowSpeed.AddTo(this); + compositeDisposable.AddTo(this); } public void RespawnCorn() @@ -63,6 +64,7 @@ public class CornManager : MonoBehaviour cornArray[i] = corn; corn.SetCornProperty(baseCornPopTime, cornBurntDuration); + // 進行速度の変更時、コーン速度変更 cornGrowSpeed.TakeWhile(_ => !isCompleted).Subscribe(x => { // コーンが弾けた後はRedの場合のみ焦げ進行する @@ -80,6 +82,7 @@ public class CornManager : MonoBehaviour .FirstOrDefault() .Subscribe(_ => { + // ThermalCondition.Hot以外では焦げ進行なし if (!isHot) { corn.ChangeGrowSpeed(0f); diff --git a/popcorn/Assets/PopcornGameManager.cs b/popcorn/Assets/PopcornGameManager.cs index 70fe4ba3..71da3599 100644 --- a/popcorn/Assets/PopcornGameManager.cs +++ b/popcorn/Assets/PopcornGameManager.cs @@ -35,6 +35,8 @@ public class PopcornGameManager : MonoBehaviour // Start is called before the first frame update void Start() { + compositeDisposable.AddTo(this); + thermalControl.Condition.Subscribe(x => { cornManager.ChangeGrowSpeed(x);