購入タイミング改善
This commit is contained in:
parent
0026bc4a24
commit
8d16ee3456
|
|
@ -97,7 +97,6 @@ public class Market : MonoBehaviour
|
||||||
orderSubject
|
orderSubject
|
||||||
.Merge(waitCustomerList.ObserveAdd().AsUnitObservable())
|
.Merge(waitCustomerList.ObserveAdd().AsUnitObservable())
|
||||||
.Merge(shopState.Where(x => x == ShopState.Open).AsUnitObservable())
|
.Merge(shopState.Where(x => x == ShopState.Open).AsUnitObservable())
|
||||||
.Where(_ => shopState.Value == ShopState.Open)
|
|
||||||
.BatchFrame()
|
.BatchFrame()
|
||||||
.Where(_ => waitCustomerList.Count > 0)
|
.Where(_ => waitCustomerList.Count > 0)
|
||||||
.SelectMany(_ => waitCustomerList.ToList().GetRange(0, Mathf.Min(maxOrder, waitCustomerList.Count)))
|
.SelectMany(_ => waitCustomerList.ToList().GetRange(0, Mathf.Min(maxOrder, waitCustomerList.Count)))
|
||||||
|
|
@ -126,20 +125,21 @@ public class Market : MonoBehaviour
|
||||||
.Select(x => x.Value)
|
.Select(x => x.Value)
|
||||||
.Subscribe(customerController =>
|
.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)
|
if (shopState.Value == ShopState.Close)
|
||||||
{
|
{
|
||||||
customerController.ChangeCustomerState(CustomerState.Leave);
|
customerController.ChangeCustomerState(CustomerState.Leave);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
customerController.State
|
||||||
|
.Where(x => x == CustomerState.EatingLeave)
|
||||||
|
.Subscribe(c =>
|
||||||
|
{
|
||||||
|
orderSubject.OnNext(default);
|
||||||
|
}).AddTo(customerController);
|
||||||
|
|
||||||
// 店に向かう
|
// 店に向かう
|
||||||
customerController.ChangeCustomerState(CustomerState.Wait);
|
customerController.ChangeCustomerState(CustomerState.Wait);
|
||||||
|
|
||||||
shopState
|
shopState
|
||||||
.Where(x => x == ShopState.Close)
|
.Where(x => x == ShopState.Close)
|
||||||
.Subscribe(x =>
|
.Subscribe(x =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue