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