fix:更换sdk,修复bug

This commit is contained in:
barry
2026-06-06 16:55:32 +08:00
parent bd28506b1f
commit 7003140acc
565 changed files with 44334 additions and 43789 deletions
@@ -119,7 +119,7 @@ namespace RedHotRoast
{
// Debug.Log("OnclickSpace");
#if !UNITY_EDITOR
MaxSdk.ShowMediationDebugger();
// MaxSdk.ShowMediationDebugger();
#endif
}
-3
View File
@@ -210,9 +210,6 @@ namespace RedHotRoast
}
void Setbg(object a = null)
{
return;
if (!GameHelper.IsGiftSwitch())
{
return;
@@ -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();
}
}
+1 -1
View File
@@ -1041,7 +1041,7 @@ namespace RedHotRoast
CheckFeature();
if (GameHelper.IsGiftSwitch() && GameHelper.GetCommonModel().Assitant == 1 && GameHelper.GetLevel() >= GameHelper.GetCommonModel().AssitantPreview)
{
ui.btn_chat.visible = true;
// ui.btn_chat.visible = true;
}
}
@@ -248,10 +248,10 @@ namespace RedHotRoast
bool is_paid = list[index].is_paid;
item.btn_buy.index.selectedIndex = 0;
// item.off_text.text = list[index].Discount_rate + "%";
// item.discount.visible = !GameHelper.IsAdModelOfPay() && list[index].Discount_rate > 0;
//
// if (list[index].Discount_rate != 0) item.off_text.text = list[index].Discount_rate + "%";
item.off_text.text = list[index].Discount_rate + "%";
item.discount.visible = !GameHelper.IsAdModelOfPay() && list[index].Discount_rate > 0;
if (list[index].Discount_rate != 0) item.off_text.text = list[index].Discount_rate + "%";
if (time + list[index].receive_CD < GameHelper.GetNowTime())
{
@@ -263,7 +263,7 @@ namespace RedHotRoast
if (!is_paid)
{
item.btn_buy.btn_text.text = "Free";
// item.discount.visible = false;
item.discount.visible = false;
item.index.selectedIndex = 0;
}
else
@@ -384,9 +384,10 @@ namespace RedHotRoast
var test = new AdExchangeData()
{
ad_count = AdExchangeManager.Instance.GetCeilingNeedAds(skuType),
type = $"buy_gold{index}",
type = skuType,
shopName = $"buy_gold{index}"
};
Debug.Log($"amount============={test.ad_count}");
AdExchangeManager.Instance.Exchange(test);
}
else
@@ -269,8 +269,14 @@ namespace RedHotRoast
DataMgr.LevelUnlockVIP.Value = Vip_Alubum;
}
FreeImageLibrary free_ImageLibrary = ConfigSystem.GetFreeImageConfig()[DataMgr.LevelUnlockFree.Value];
Debug.Log($"DataMgr.LevelUnlockFree.Value----------------{DataMgr.LevelUnlockFree.Value}");
var freeIamgeList = ConfigSystem.GetFreeImageConfig();
var freeIndex = DataMgr.LevelUnlockFree.Value;
if (freeIndex < 0 || freeIndex >= freeIamgeList.Count)
{
freeIndex = freeIndex < 0 ? 0 : freeIamgeList.Count - 1;
}
FreeImageLibrary free_ImageLibrary = ConfigSystem.GetFreeImageConfig()[freeIndex];
ui.item_0.btn_unlock.pay_type.selectedIndex = 2;
ui.item_0_re.btn_unlock.visible = false;
TextureHelper.SetImgLoader(ui.item_0.com_pic.picture, free_ImageLibrary.Name, (s) =>
@@ -279,6 +285,15 @@ namespace RedHotRoast
}, "LevelAlbums/", FolderNames.AlbumName);
int Free_Alubum_1 = PlayerPrefs.GetInt("Free_Alubum_1", -1);
var freeImageLibraryList = ConfigSystem.GetFreeImageConfig();
if (Free_Alubum_1 < 0)
{
Free_Alubum_1 = 0;
}
else if (Free_Alubum_1 >= freeImageLibraryList.Count)
{
Free_Alubum_1 = freeImageLibraryList.Count - 1;
}
FreeImageLibrary free_ImageLibrary_re = ConfigSystem.GetFreeImageConfig()[Free_Alubum_1];
TextureHelper.SetImgLoader(ui.item_0_re.com_pic.picture, free_ImageLibrary_re.Name, (s) =>
{
@@ -315,7 +330,13 @@ namespace RedHotRoast
ADImageLibrary ad_ImageLibrary = ConfigSystem.GetADImageConfig()[DataMgr.LevelUnlockAD.Value];
var adImageLibraryList = ConfigSystem.GetADImageConfig();
int adIndex = DataMgr.LevelUnlockAD.Value;
if (adIndex < 0 || adIndex >= adImageLibraryList.Count)
{
adIndex = adIndex < 0 ? 0 : adImageLibraryList.Count - 1;
}
ADImageLibrary ad_ImageLibrary = ConfigSystem.GetADImageConfig()[adIndex];
TextureHelper.SetImgLoader(ui.item_1.com_pic.picture, ad_ImageLibrary.Name, (s) =>
{
if (ad_ImageLibrary.State == 1) TextureHelper.SetImageBlur(ui.item_1.com_pic.picture);
@@ -336,12 +357,21 @@ namespace RedHotRoast
});
var specialImageLibraryList = ConfigSystem.GetSpecialImageConfig();
var specialIndex = DataMgr.LevelUnlockSpecial.Value;
if (specialIndex < 0 || specialIndex >= specialImageLibraryList.Count)
{
specialIndex = specialIndex < 0 ? 0 : specialImageLibraryList.Count - 1;
}
bool have_special = GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>());
SpecialImageLibrary special_ImageLibrary = ConfigSystem.GetSpecialImageConfig()[DataMgr.LevelUnlockSpecial.Value];
SpecialImageLibrary special_ImageLibrary = ConfigSystem.GetSpecialImageConfig()[specialIndex];
TextureHelper.SetImgLoader(ui.item_2.com_pic.picture, special_ImageLibrary.Name, (s) =>
{
if (special_ImageLibrary.State == 1 && !have_special) TextureHelper.SetImageBlur(ui.item_2.com_pic.picture);
}, "LevelAlbums/", FolderNames.AlbumName);
Debug.Log($"DataMgr.LevelUnlockSpecial.Value======{DataMgr.LevelUnlockSpecial.Value} {have_special}");
if (have_special)
{
ui.item_2.btn_unlock.visible = false;
@@ -389,7 +419,13 @@ namespace RedHotRoast
}
bool have_vip = GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>());
VIPImageLibrary vip_ImageLibrary = ConfigSystem.GetVIPImageConfig()[DataMgr.LevelUnlockVIP.Value];
var vipImageLibraryList = ConfigSystem.GetVIPImageConfig();
var vipIndex = DataMgr.LevelUnlockVIP.Value;
if (vipIndex < 0 || vipIndex >= vipImageLibraryList.Count)
{
vipIndex = vipIndex < 0 ? 0 : vipImageLibraryList.Count - 1;
}
VIPImageLibrary vip_ImageLibrary = ConfigSystem.GetVIPImageConfig()[vipIndex];
TextureHelper.SetImgLoader(ui.item_3.com_pic.picture, vip_ImageLibrary.Name, (s) =>
{