お客さんがポップコーン購入後、正しく種類が設定さればい場合を解決

This commit is contained in:
kimura 2021-11-12 11:22:39 +09:00
parent 2969c2d950
commit ecfc88bdeb
2 changed files with 10 additions and 0 deletions

View File

@ -93,6 +93,10 @@ public class CustomerAnimator : MonoBehaviour
Instantiate(prefab, rightPopcornTarget).ChangeRarity(rarity); Instantiate(prefab, rightPopcornTarget).ChangeRarity(rarity);
Instantiate(prefab, frontPopcornTarget).ChangeRarity(rarity); Instantiate(prefab, frontPopcornTarget).ChangeRarity(rarity);
Instantiate(prefab, wantFlavorSpriteTarget).ChangeRarity(rarity); Instantiate(prefab, wantFlavorSpriteTarget).ChangeRarity(rarity);
}
public void ShowWantFlavor()
{
orderPopup.SetActive(true); orderPopup.SetActive(true);
} }

View File

@ -291,6 +291,11 @@ public class MarketManager : MonoBehaviour
{ {
customerAnimator.SetSide(x); customerAnimator.SetSide(x);
}).AddTo(customerAnimator); }).AddTo(customerAnimator);
// フレーバー設定
if (productDataList.FirstOrDefault(data => data.id == (controller.WantFlavor.Value?.FlavorId ?? -1))?.GetMarketPrefab() is MarketPopcornView initialPrefab)
{
customerAnimator.SetWantFlavor(initialPrefab, controller.WantFlavor.Value.Rarity);
}
controller.WantFlavor controller.WantFlavor
.SkipLatestValueOnSubscribe() .SkipLatestValueOnSubscribe()
.Subscribe(wantData => .Subscribe(wantData =>
@ -298,6 +303,7 @@ public class MarketManager : MonoBehaviour
if (productDataList.FirstOrDefault(data => data.id == wantData.FlavorId)?.GetMarketPrefab() is MarketPopcornView prefab) if (productDataList.FirstOrDefault(data => data.id == wantData.FlavorId)?.GetMarketPrefab() is MarketPopcornView prefab)
{ {
customerAnimator.SetWantFlavor(prefab, wantData.Rarity); customerAnimator.SetWantFlavor(prefab, wantData.Rarity);
customerAnimator.ShowWantFlavor();
} }
}).AddTo(customerAnimator); }).AddTo(customerAnimator);
controller.IsComplain controller.IsComplain