提交
This commit is contained in:
@@ -134,7 +134,7 @@ namespace ScrewsMaster
|
||||
_payBoxPrice = (int)ConfigSystem.GetConfig<CommonModel>().addspace;
|
||||
if (type != 3)
|
||||
{
|
||||
_payBoxPrice = ConfigSystem.GetConfig<CommonModel>().Purchaseprops;
|
||||
_payBoxPrice = 1;
|
||||
|
||||
}
|
||||
|
||||
@@ -195,38 +195,38 @@ namespace ScrewsMaster
|
||||
{
|
||||
if (type != 3)
|
||||
{
|
||||
if (_needWatchAds)
|
||||
// if (_needWatchAds)
|
||||
// {
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyProp + "_" + type, 1);
|
||||
GameHelper.ShowVideoAd($"Prop", success =>
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyProp + "_" + type, 1);
|
||||
GameHelper.ShowVideoAd($"Prop", success =>
|
||||
if (success)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
GameHelper.UpdateAdRewardExchangeTime();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.use_prop, type);
|
||||
// GameHelper.AddAdWatchCount(-_payBoxPrice);
|
||||
SetButtonsTouchable(false);
|
||||
CtrlCloseUI();
|
||||
ShowScrews.Instance.ShowToast("Successfully used the props");
|
||||
}
|
||||
});
|
||||
return;
|
||||
//}
|
||||
|
||||
if (GameHelper.CheckAdWatchCount(_payBoxPrice))
|
||||
{
|
||||
GameHelper.AddAdWatchCount(-_payBoxPrice);
|
||||
// if (GameHelper.CheckAdWatchCount(_payBoxPrice))
|
||||
// {
|
||||
// GameHelper.AddAdWatchCount(-_payBoxPrice);
|
||||
|
||||
// ShowScrews.Instance.OnSuccessPayBox1(num);
|
||||
// SetButtonsTouchable(false);
|
||||
// CtrlCloseUI();
|
||||
// ShowScrews.Instance.ShowToast("Successful purchase");
|
||||
if (type == 0) GameHelper.AddItemNumber(ItemEnum.AddHole, 1);
|
||||
else if (type == 1) GameHelper.AddItemNumber(ItemEnum.MergeBox, 1);
|
||||
else if (type == 2) GameHelper.AddItemNumber(ItemEnum.ClearHole, 1);
|
||||
SetButtonsTouchable(false);
|
||||
CtrlCloseUI();
|
||||
ShowScrews.Instance.ShowToast("Exchange successful");
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Insufficient AdWatchCount");
|
||||
}
|
||||
// // ShowScrews.Instance.OnSuccessPayBox1(num);
|
||||
// // SetButtonsTouchable(false);
|
||||
// // CtrlCloseUI();
|
||||
// // ShowScrews.Instance.ShowToast("Successful purchase");
|
||||
// // GameHelper.AddItemNumber(ItemEnum.ClearHole, 1);
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.ShowTips("Insufficient AdWatchCount");
|
||||
// }
|
||||
}
|
||||
else if (type == 3)
|
||||
{
|
||||
@@ -301,23 +301,32 @@ namespace ScrewsMaster
|
||||
_needWatchAds = false;
|
||||
ui.btn_PayBox.touchable = true;
|
||||
ui.btn_PayBox.grayed = false;
|
||||
if (GameHelper.CheckAdWatchCount(_payBoxPrice))
|
||||
if (type == 3)
|
||||
{
|
||||
ui.btn_PayBox.text = "Claim";
|
||||
}
|
||||
else if (GameHelper.InAdRewardCooldown())
|
||||
{
|
||||
ui.btn_PayBox.text = CommonHelper.TimeFormat((int)GameHelper.GetAdRewardCooldownTime() - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
ui.btn_PayBox.touchable = false;
|
||||
ui.btn_PayBox.grayed = true;
|
||||
if (GameHelper.CheckAdWatchCount(_payBoxPrice))
|
||||
{
|
||||
ui.btn_PayBox.text = "Claim";
|
||||
}
|
||||
else if (GameHelper.InAdRewardCooldown())
|
||||
{
|
||||
ui.btn_PayBox.text = CommonHelper.TimeFormat((int)GameHelper.GetAdRewardCooldownTime() - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
ui.btn_PayBox.touchable = false;
|
||||
ui.btn_PayBox.grayed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_PayBox.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
|
||||
_needWatchAds = true;
|
||||
ui.btn_PayBox.text = $"Watch Ad";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_PayBox.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
|
||||
_needWatchAds = true;
|
||||
ui.btn_PayBox.text = $"Watch Ad";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void SetButtonsTouchable(bool b)
|
||||
|
||||
Reference in New Issue
Block a user