購入タイミング改善
This commit is contained in:
parent
0026bc4a24
commit
8d16ee3456
|
|
@ -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 =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue