From 2969c2d9500cb672dbf8fda1003fbe299921c0ca Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 12 Nov 2021 11:11:15 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=8A=E5=AE=A2=E3=81=95=E3=82=93=E3=81=AE?= =?UTF-8?q?=E8=B3=BC=E5=85=A5=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E3=81=A8?= =?UTF-8?q?=E3=82=BB=E3=83=AC=E3=83=96=E5=AE=A2=E3=81=AE=E5=87=BA=E7=8F=BE?= =?UTF-8?q?=E7=A2=BA=E7=8E=87=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/marketing/Scripts/Market.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs index 2f85242d..cc086b3f 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs @@ -18,14 +18,17 @@ public enum ShopState public class Market : SingletonMonoBehaviour { public static readonly int ShopStockCount = 20; + private static readonly int SpecialOrderCount = 5; private static readonly (int want, float weight)[] CustomerWeightTable = { - (1, 70f), - (2, 20f), - (3, 3f), - (4, 1.5f), - (5, .5f), + (1, 75f), + (2, 15f), + (3, 3.5f), + (4, 1.25f), + (5, .25f), (0, 5f), }; + private static readonly float walkerSpecialRate = .01f; + private static readonly float customerSpecialRate = .01f; [SerializeField] private CustomerFlow customerFlow; [SerializeField] private GameObject orderPosisionObject; @@ -340,10 +343,11 @@ public class Market : SingletonMonoBehaviour public static (bool isSpecial, int orderCount) GetCustomerData (bool isCustomer) { - var isSpecial = isCustomer ? Random.value < .01f : Random.value < .03f; + var specialRate = isCustomer ? walkerSpecialRate : customerSpecialRate; + var isSpecial = Random.value < specialRate; // セレブは5個購入固定 - return isSpecial ? (true, 5) : (false, GetOrderCount()); + return isSpecial ? (true, specialOrderCount: SpecialOrderCount) : (false, GetOrderCount()); } // お客さん出現パターン確率計算と行動パターン計算