fix:更换sdk,修复bug
This commit is contained in:
@@ -41,7 +41,7 @@ namespace RedHotRoast
|
||||
{
|
||||
AdExchangeManager.Instance.Destroy();
|
||||
GameHelper.showGameUI = true;
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent -= RemoveAdCountDown;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.pack_close);
|
||||
int three_gift_got_index = SaveData.GetSaveObject().three_gift_got_index;
|
||||
// if (GameHelper.isAutoPop && (three_gift_got_index <= (int)rewardState.day3))
|
||||
@@ -235,7 +235,7 @@ namespace RedHotRoast
|
||||
decimal price_pack = (decimal)list[0].Paid_price2;
|
||||
ui.btn_max_pack.title = GameHelper.Get102Str(price_pack);
|
||||
bool is_get = SaveData.GetSaveObject().is_get_packreward;
|
||||
Debug.Log($"is_get================{is_get}");
|
||||
// Debug.Log($"is_get================{is_get}");
|
||||
if (is_get)
|
||||
{
|
||||
ui.btn_max_pack.enabled = false;
|
||||
@@ -258,7 +258,7 @@ namespace RedHotRoast
|
||||
decimal price_remove = (decimal)list[1].Paid_price2;
|
||||
ui.btn_max_remove.title = GameHelper.Get102Str(price_remove);
|
||||
bool is_get1 = SaveData.GetSaveObject().is_get_removead;
|
||||
Debug.Log($"is_get1================{is_get1}");
|
||||
// Debug.Log($"is_get1================{is_get1}");
|
||||
if (is_get1)
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent += RemoveAdCountDown;
|
||||
@@ -276,6 +276,7 @@ namespace RedHotRoast
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_max_remove.enabled = true;
|
||||
ui.btn_max_remove.SetClick(() =>
|
||||
{
|
||||
ApplePayClass maxPayData = new ApplePayClass
|
||||
@@ -293,6 +294,8 @@ namespace RedHotRoast
|
||||
ui.pay_type.selectedIndex = 0;
|
||||
AdExchangeManager.Instance.Start();
|
||||
SetTextString1();
|
||||
|
||||
|
||||
|
||||
decimal price_remove = (decimal)list[1].Paid_price2;
|
||||
bool is_get1 = SaveData.GetSaveObject().is_get_removead;
|
||||
@@ -300,24 +303,11 @@ namespace RedHotRoast
|
||||
if (is_get1)
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent += RemoveAdCountDown;
|
||||
|
||||
ui.btn_buyremovead.enabled = false;
|
||||
ui.btn_buyremovead.SetClick(() => { });
|
||||
|
||||
var lastTimes = SaveData.GetSaveObject()._watch_ad_cd;
|
||||
if (GameHelper.GetNowTime() < lastTimes)
|
||||
{
|
||||
|
||||
}
|
||||
int cd = SaveData.GetSaveObject().remove_ad_time - Convert.ToInt32(GameHelper.GetNowTime());
|
||||
if (cd > 24 * 3600)
|
||||
{
|
||||
ui.btn_buyremovead.title = CommonHelper.TimeFormat(cd, CountDownType.Day, "D");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_buyremovead.title = CommonHelper.TimeFormat(cd, CountDownType.Hour);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_buyremovead1.visible = false;
|
||||
ui.btn_buyremovead.visible = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -327,23 +317,29 @@ namespace RedHotRoast
|
||||
private void RemoveAdCountDown()
|
||||
{
|
||||
int cd = SaveData.GetSaveObject().remove_ad_time - Convert.ToInt32(GameHelper.GetNowTime());
|
||||
Debug.Log($"cd=========={cd}");
|
||||
if (cd > 0)
|
||||
{
|
||||
ui.btn_buyremovead1.visible = true;
|
||||
ui.btn_buyremovead.visible = false;
|
||||
((btn_watchAd)ui.btn_buyremovead1).can_buy.selectedIndex = 1;
|
||||
if (cd > 24 * 3600)
|
||||
{
|
||||
ui.btn_max_remove.title = CommonHelper.TimeFormat(cd, CountDownType.Day, "D");
|
||||
ui.btn_buyremovead.title = CommonHelper.TimeFormat(cd, CountDownType.Day, "D");
|
||||
((btn_watchAd)ui.btn_buyremovead1).btn_text.text = CommonHelper.TimeFormat(cd, CountDownType.Day, "D");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_max_remove.title = CommonHelper.TimeFormat(cd, CountDownType.Hour);
|
||||
ui.btn_buyremovead.title = CommonHelper.TimeFormat(cd, CountDownType.Hour);
|
||||
((btn_watchAd)ui.btn_buyremovead1).btn_text.text = CommonHelper.TimeFormat(cd, CountDownType.Hour);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SaveData.GetSaveObject().is_get_removead = false;
|
||||
SaveData.GetSaveObject().remove_ad_time = 0;
|
||||
ui.btn_buyremovead1.visible = false;
|
||||
ui.btn_buyremovead.visible = true;
|
||||
InitView();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user