From 8d16ee34566848c9235ca63f0c8cdf40f266d231 Mon Sep 17 00:00:00 2001 From: kimura Date: Wed, 8 Sep 2021 17:03:05 +0900 Subject: [PATCH] =?UTF-8?q?=E8=B3=BC=E5=85=A5=E3=82=BF=E3=82=A4=E3=83=9F?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/marketing/Scripts/Market.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs index 7c11b71e..7cbc2086 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/Market.cs @@ -97,7 +97,6 @@ public class Market : MonoBehaviour orderSubject .Merge(waitCustomerList.ObserveAdd().AsUnitObservable()) .Merge(shopState.Where(x => x == ShopState.Open).AsUnitObservable()) - .Where(_ => shopState.Value == ShopState.Open) .BatchFrame() .Where(_ => waitCustomerList.Count > 0) .SelectMany(_ => waitCustomerList.ToList().GetRange(0, Mathf.Min(maxOrder, waitCustomerList.Count))) @@ -126,20 +125,21 @@ public class Market : MonoBehaviour .Select(x => x.Value) .Subscribe(customerController => { - customerController.State - .Where(x => x == CustomerState.EatingLeave) - .Subscribe(c => - { - Debug.Log($"aa order:{customerList.Count(x => x.State.Value == CustomerState.Order)} EatingLeave"); - orderSubject.OnNext(default); - }).AddTo(customerController); if (shopState.Value == ShopState.Close) { customerController.ChangeCustomerState(CustomerState.Leave); return; } + customerController.State + .Where(x => x == CustomerState.EatingLeave) + .Subscribe(c => + { + orderSubject.OnNext(default); + }).AddTo(customerController); + // 店に向かう customerController.ChangeCustomerState(CustomerState.Wait); + shopState .Where(x => x == ShopState.Close) .Subscribe(x =>