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 =>