From ac7f930732ad5d614dab53051b994d85b034ec79 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 19 Jul 2021 13:44:00 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=B3=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=99=82=E9=96=93=E3=81=AE=E8=AA=BF=E6=95=B4=E7=AE=87=E6=89=80?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs | 4 ++-- popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs index fe1032a0..55887797 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs @@ -146,8 +146,8 @@ public class Corn : MonoBehaviour public void SetCornProperty(float popTime, float burntDuration, float spillSpeed, float popSpeed) { - cornPopTime = popTime + Random.Range(0, 5f); - cornBurntTime = cornPopTime + burntDuration + Random.Range(0, 1f); + cornPopTime = popTime; + cornBurntTime = cornPopTime + burntDuration; cornSpillSpeed = spillSpeed; cornPopSpeed = popSpeed; } diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs index 9278f7aa..ccf06e07 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs @@ -29,7 +29,9 @@ public class CornManager : MonoBehaviour [SerializeField] private float coldGrowSpeed = .1f; [SerializeField] private float hotGrowSpeed = 2f; [SerializeField] private float baseCornPopTime = 5f; + [SerializeField] private float cornPopRandom = 5f; [SerializeField] private float cornBurntDuration = 5f; + [SerializeField] private float cornBurntRandom = 1f; [SerializeField] private float cornSpillSpeed = 50f; [SerializeField] private float cornPopSpeed = 20f; @@ -137,7 +139,7 @@ public class CornManager : MonoBehaviour { var corn = Instantiate(cornPrefab, cornSpawnTarget); cornArray[i] = corn; - corn.SetCornProperty(baseCornPopTime, cornBurntDuration, cornSpillSpeed, cornPopSpeed); + corn.SetCornProperty(baseCornPopTime + Random.Range(0f, cornPopRandom), cornBurntDuration + Random.Range(0f, cornBurntRandom), cornSpillSpeed, cornPopSpeed); // 進行速度の変更時、コーン速度変更 cornGrowSpeed.TakeWhile(_ => !isCompleted).Subscribe(x =>