所持金0時に直接広告視聴ポップアップを出す処理を追加
This commit is contained in:
parent
d5a79cae10
commit
3bf5ec9381
|
|
@ -18,9 +18,12 @@ public class KitchenManager : MonoBehaviour
|
|||
[SerializeField] private KitchenView kitchenView;
|
||||
[SerializeField] private BulkOrderIndicatorView orderIndicatorView;
|
||||
|
||||
private readonly Subject<Unit> showAdDialogSubject = new Subject<Unit>();
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
showAdDialogSubject.AddTo(this);
|
||||
SoundManager.Instance.PlayBGM("bgm_Main");
|
||||
var gameData = GameDataManager.GameData;
|
||||
|
||||
|
|
@ -106,23 +109,25 @@ public class KitchenManager : MonoBehaviour
|
|||
}).AddTo(this);
|
||||
|
||||
kitchenView.Initialize();
|
||||
adButton.OnClickAsObservable().ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ =>
|
||||
{
|
||||
// 動画視聴POP
|
||||
GetRewardDialog.ShowCoinDialog(() =>
|
||||
adButton.OnClickAsObservable()
|
||||
.Merge(showAdDialogSubject)
|
||||
.ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ =>
|
||||
{
|
||||
CoinGetDialog.ShowDialog(refreshRewardCoin, () =>
|
||||
// 動画視聴POP
|
||||
GetRewardDialog.ShowCoinDialog(() =>
|
||||
{
|
||||
adButton.gameObject.SetActive(false);
|
||||
kitchenView.SetNormalAnimation();
|
||||
|
||||
CoinManager.Instance.AddCoinWithEffect(refreshRewardCoin);
|
||||
gameData.Coin = CoinManager.Instance.OwnCoin;
|
||||
gameData.kitchenRefreshTime = DateTime.UtcNow.AddSeconds(refreshWaitTime).ToBinary();
|
||||
GameDataManager.SaveGameData();
|
||||
CoinGetDialog.ShowDialog(refreshRewardCoin, () =>
|
||||
{
|
||||
adButton.gameObject.SetActive(false);
|
||||
kitchenView.SetNormalAnimation();
|
||||
|
||||
CoinManager.Instance.AddCoinWithEffect(refreshRewardCoin);
|
||||
gameData.Coin = CoinManager.Instance.OwnCoin;
|
||||
gameData.kitchenRefreshTime = DateTime.UtcNow.AddSeconds(refreshWaitTime).ToBinary();
|
||||
GameDataManager.SaveGameData();
|
||||
});
|
||||
});
|
||||
});
|
||||
}).AddTo(this);
|
||||
}).AddTo(this);
|
||||
|
||||
// 休憩リワード
|
||||
var remaining = (int) DateTime.FromBinary(gameData.kitchenRefreshTime).Subtract(DateTime.UtcNow).TotalSeconds;
|
||||
|
|
@ -137,6 +142,7 @@ public class KitchenManager : MonoBehaviour
|
|||
// 所持金0救済
|
||||
adButton.gameObject.SetActive(true);
|
||||
kitchenView.SetTiredAnimation();
|
||||
showAdDialogSubject.OnNext(Unit.Default);
|
||||
}
|
||||
else if (remaining > 0 || gameData.isFirstPlay)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue