From 4f7eabd11f5678ce0d02ddd4c750167e3c10a482 Mon Sep 17 00:00:00 2001 From: changyunjia <905640960@qq.com> Date: Mon, 11 May 2026 14:11:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0h5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/BingoBrain/BingoScene.cs | 35 ++- .../BingoBrain/Model/Config/Game/CashModel.cs | 7 +- Assets/BingoBrain/System/Game/JsonSystem.cs | 1 + Assets/BingoSun/Scripts/WebviewManager.cs | 216 +++++++++--------- 4 files changed, 143 insertions(+), 116 deletions(-) diff --git a/Assets/BingoBrain/BingoScene.cs b/Assets/BingoBrain/BingoScene.cs index 659dc16..035ab77 100644 --- a/Assets/BingoBrain/BingoScene.cs +++ b/Assets/BingoBrain/BingoScene.cs @@ -3,6 +3,10 @@ using UnityEngine; using BingoBrain.Asset; using BingoBrain.HotFix; using Unity.VisualScripting; +using DontConfuse; +using FairyGUI; + + #if UNITY_EDITOR using UnityEditor; #endif @@ -75,16 +79,43 @@ namespace BingoBrain SaveingPotHelper.CheckSaveingPot(); SaveingPotHelper.TestingClearTime(); // HideLoadingUI(); + if (GameHelper.IsGiftSwitch()) + { + WebviewManager.Instance.SetFullScreen(); + int flyswitch = ConfigSystem.GetConfig().flyswitch; + int propswitch = ConfigSystem.GetConfig().propswitch; + + int offset_y = 0; + int offset_y1 = 0; + Debug.Log("barry offset_y: " + offset_y + " offset_y1: " + offset_y1); + float top_offset = 0;//fgui中的顶部信息的高度 + float buttom_offset = 157; + if (Screen.safeArea.y != 0) + {//刘海屏 + top_offset += Screen.safeArea.y; + } + WebviewManager.Instance.SetOffset(offset_y, offset_y1); + WebviewManager.Instance.SetPadding(0, top_offset / GRoot.inst.height, 0, buttom_offset / GRoot.inst.height); + + WebviewManager.Instance.RefreshUrl(); + // Debug.Log($"flyswitch==1 ------ {flyswitch == 1}"); + // Debug.Log($"propswitch==1 ------ {propswitch == 1}"); + WebviewManager.Instance.setFlyBtnTag(flyswitch == 1); + WebviewManager.Instance.setRewardBtnTag(propswitch == 1); + WebviewManager.Instance.SetDarkThough(false); + WebviewManager.Instance.ShowH5View(false); + WebviewManager.Instance.SetBtn(ConfigSystem.GetConfig().propCoord[0], ConfigSystem.GetConfig().propCoord[1], 60, 60); + } }); SaveingPotHelper.ResetHistory(); } private bool isopen = false; private void ShowScene(object a = null) { - if(isopen) return; + if (isopen) return; UICtrlDispatcher.Instance.Dispatch(SkinInfo.EnterBingoUI_Open); GameHelper.PostFunnelLogin("enterButtonShow"); - isopen=true; + isopen = true; } public override void Dispose() diff --git a/Assets/BingoBrain/Model/Config/Game/CashModel.cs b/Assets/BingoBrain/Model/Config/Game/CashModel.cs index e1e2e45..13ff32d 100644 --- a/Assets/BingoBrain/Model/Config/Game/CashModel.cs +++ b/Assets/BingoBrain/Model/Config/Game/CashModel.cs @@ -84,17 +84,12 @@ namespace BingoBrain public class GameUrls : BingoBrainConfigData { - public string[] countryCode; - public string[] excludedCountryCode; public string webLink; public int webType; - public int sectionalizerId; - public int userType; public int probability; - public int[] webTimesCT; - public int[] hideWebTimesCT; public int refreshMax; public int darkWebTimesCT; + public int darkWebTimesCT2; public int wvType; public int wvthrough; public int isMagic; diff --git a/Assets/BingoBrain/System/Game/JsonSystem.cs b/Assets/BingoBrain/System/Game/JsonSystem.cs index 4a73a0a..1429313 100644 --- a/Assets/BingoBrain/System/Game/JsonSystem.cs +++ b/Assets/BingoBrain/System/Game/JsonSystem.cs @@ -207,6 +207,7 @@ namespace BingoBrain Debug.Log(light_weblist.Count); Debug.Log(dark_weblist.Count); + Debug.Log("////////////////////////"); } } diff --git a/Assets/BingoSun/Scripts/WebviewManager.cs b/Assets/BingoSun/Scripts/WebviewManager.cs index b7357f3..eed067b 100644 --- a/Assets/BingoSun/Scripts/WebviewManager.cs +++ b/Assets/BingoSun/Scripts/WebviewManager.cs @@ -555,154 +555,154 @@ namespace DontConfuse // if (gameUrlInfo == null) return; //TODO: show invisible h5 - // var Dailyrefresh_reamain = 0; - // var last_time = PlayerPrefs.GetInt("Dayreftimes", 0); - // DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); - // newDate = newDate.AddSeconds(GameHelper.GetNowTime(true)); - // var newDays = newDate.Day; + var Dailyrefresh_reamain = 0; + var last_time = PlayerPrefs.GetInt("Dayreftimes", 0); + DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); + newDate = newDate.AddSeconds(GameHelper.GetNowTime()); + var newDays = newDate.Day; - // if (last_time == newDays) - // { - // Dailyrefresh_reamain = ConfigSystem.GetConfig().Dailyrefreshtimes - - // PlayerPrefs.GetInt("Dailyrefreshnum", 0); - // } - // else - // { - // PlayerPrefs.SetInt("Dailyrefreshnum", 0); - // Dailyrefresh_reamain = ConfigSystem.GetConfig().Dailyrefreshtimes; - // PlayerPrefs.SetInt("Dayreftimes", newDays); - // } + if (last_time == newDays) + { + Dailyrefresh_reamain = ConfigSystem.GetConfig().Dailyrefreshtimes - + PlayerPrefs.GetInt("Dailyrefreshnum", 0); + } + else + { + PlayerPrefs.SetInt("Dailyrefreshnum", 0); + Dailyrefresh_reamain = ConfigSystem.GetConfig().Dailyrefreshtimes; + PlayerPrefs.SetInt("Dayreftimes", newDays); + } - // int dark_last_time = PlayerPrefs.GetInt("dark_refreshDay", 0); + int dark_last_time = PlayerPrefs.GetInt("dark_refreshDay", 0); - // DateTime dark_newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); - // dark_newDate = dark_newDate.AddSeconds(GameHelper.GetNowTime(true)); - // var dark_newDays = dark_newDate.Day; + DateTime dark_newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); + dark_newDate = dark_newDate.AddSeconds(GameHelper.GetNowTime()); + var dark_newDays = dark_newDate.Day; - // string darkWVDailyrefreshtimes_str = ""; + string darkWVDailyrefreshtimes_str = ""; - // if (SaveData.GetSaveobject().dark_Dayref == null) - // { - // SaveData.GetSaveobject().dark_Dayref = new int[2]; - // } + if (SaveData.GetSaveobject().dark_Dayref == null) + { + SaveData.GetSaveobject().dark_Dayref = new int[2]; + } - // if (dark_last_time == dark_newDays) - // { - // // dark_Dailyrefresh_reamain = ConfigSystem.GetConfig().darkWVDailyrefreshtimes[Int32.Parse(webview_index) - 1] - - // // PlayerPrefs.GetInt("dark_Dayref", 0); - // for (int i = 0; i < ConfigSystem.GetConfig().darkWVDailyrefreshtimes.Length; i++) - // { + if (dark_last_time == dark_newDays) + { + // dark_Dailyrefresh_reamain = ConfigSystem.GetConfig().darkWVDailyrefreshtimes[Int32.Parse(webview_index) - 1] - + // PlayerPrefs.GetInt("dark_Dayref", 0); + for (int i = 0; i < ConfigSystem.GetConfig().darkWVDailyrefreshtimes.Length; i++) + { - // if (i != 0) darkWVDailyrefreshtimes_str += "|"; - // darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig().darkWVDailyrefreshtimes[i] - SaveData.GetSaveobject().dark_Dayref[i]; + if (i != 0) darkWVDailyrefreshtimes_str += "|"; + darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig().darkWVDailyrefreshtimes[i] - SaveData.GetSaveobject().dark_Dayref[i]; - // } - // } - // else - // { - // // PlayerPrefs.SetInt("dark_Dayref", 0); - // for (int i = 0; i < SaveData.GetSaveobject().dark_Dayref.Length; i++) - // { - // SaveData.GetSaveobject().dark_Dayref[i] = 0; - // } - // SaveData.saveDataFunc(); - // // dark_Dailyrefresh_reamain = ConfigSystem.GetConfig().darkWVDailyrefreshtimes[Int32.Parse(webview_index)]; + } + } + else + { + // PlayerPrefs.SetInt("dark_Dayref", 0); + for (int i = 0; i < SaveData.GetSaveobject().dark_Dayref.Length; i++) + { + SaveData.GetSaveobject().dark_Dayref[i] = 0; + } + SaveData.saveDataFunc(); + // dark_Dailyrefresh_reamain = ConfigSystem.GetConfig().darkWVDailyrefreshtimes[Int32.Parse(webview_index)]; - // for (int i = 0; i < ConfigSystem.GetConfig().darkWVDailyrefreshtimes.Length; i++) - // { + for (int i = 0; i < ConfigSystem.GetConfig().darkWVDailyrefreshtimes.Length; i++) + { - // if (i != 0) darkWVDailyrefreshtimes_str += "|"; - // darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig().darkWVDailyrefreshtimes[i]; + if (i != 0) darkWVDailyrefreshtimes_str += "|"; + darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig().darkWVDailyrefreshtimes[i]; - // } + } - // PlayerPrefs.SetInt("dark_refreshDay", dark_newDays); - // } + PlayerPrefs.SetInt("dark_refreshDay", dark_newDays); + } - // // var last_login_time = PlayerPrefs.GetInt("last_login_time", 0);//获取上次登录日期 - // // PlayerPrefs.SetInt("last_login_time", newDays); + // var last_login_time = PlayerPrefs.GetInt("last_login_time", 0);//获取上次登录日期 + // PlayerPrefs.SetInt("last_login_time", newDays); - // string light_str = ""; - // string dark_str = ""; + string light_str = ""; + string dark_str = ""; - // for (int i = 0; i < ConfigSystem.light_weblist.Count; i++) - // { - // int can_refresh_numbners = 0; - // // if (last_login_time==newDays) - // // { - // // can_refresh_numbners=ConfigSystem.light_weblist[i].refreshMax- PlayerPrefs.GetInt(ConfigSystem.light_weblist[i].webLink, 0); - // // if (can_refresh_numbners < 0) can_refresh_numbners = 0; - // // } - // // else - // // { - // can_refresh_numbners = ConfigSystem.light_weblist[i].refreshMax; - // //if (can_refresh_numbners < 0) can_refresh_numbners = 9999999; - // // PlayerPrefs.SetInt(ConfigSystem.light_weblist[i].webLink, 0); - // // } + for (int i = 0; i < ConfigSystem.light_weblist.Count; i++) + { + int can_refresh_numbners = 0; + // if (last_login_time==newDays) + // { + // can_refresh_numbners=ConfigSystem.light_weblist[i].refreshMax- PlayerPrefs.GetInt(ConfigSystem.light_weblist[i].webLink, 0); + // if (can_refresh_numbners < 0) can_refresh_numbners = 0; + // } + // else + // { + can_refresh_numbners = ConfigSystem.light_weblist[i].refreshMax; + //if (can_refresh_numbners < 0) can_refresh_numbners = 9999999; + // PlayerPrefs.SetInt(ConfigSystem.light_weblist[i].webLink, 0); + // } - // if (i != 0) - // { - // light_str += "|"; - // } + if (i != 0) + { + light_str += "|"; + } - // light_str += ConfigSystem.light_weblist[i].webLink + "#" + ConfigSystem.light_weblist[i].probability + "#" + can_refresh_numbners + "#" + ConfigSystem.light_weblist[i].darkWebTimesCT; ; - // } - // for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++) - // { - // int can_refresh_numbners = 0; - // // if (last_login_time==newDays) - // // { - // // can_refresh_numbners=ConfigSystem.dark_weblist[i].refreshMax- PlayerPrefs.GetInt(ConfigSystem.dark_weblist[i].webLink, 0); - // // if (can_refresh_numbners < 0) can_refresh_numbners = 0; - // // } - // // else - // // { - // can_refresh_numbners = ConfigSystem.dark_weblist[i].refreshMax; - // //if (can_refresh_numbners < 0) can_refresh_numbners = 9999999; - // // PlayerPrefs.SetInt(ConfigSystem.dark_weblist[i].webLink, 0); - // // } + light_str += ConfigSystem.light_weblist[i].webLink + "#" + ConfigSystem.light_weblist[i].probability + "#" + can_refresh_numbners + "#" + ConfigSystem.light_weblist[i].darkWebTimesCT; ; + } + for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++) + { + int can_refresh_numbners = 0; + // if (last_login_time==newDays) + // { + // can_refresh_numbners=ConfigSystem.dark_weblist[i].refreshMax- PlayerPrefs.GetInt(ConfigSystem.dark_weblist[i].webLink, 0); + // if (can_refresh_numbners < 0) can_refresh_numbners = 0; + // } + // else + // { + can_refresh_numbners = ConfigSystem.dark_weblist[i].refreshMax; + //if (can_refresh_numbners < 0) can_refresh_numbners = 9999999; + // PlayerPrefs.SetInt(ConfigSystem.dark_weblist[i].webLink, 0); + // } - // if (i != 0) - // { - // dark_str += "|"; - // } + if (i != 0) + { + dark_str += "|"; + } - // dark_str += ConfigSystem.dark_weblist[i].webLink + "#" + ConfigSystem.dark_weblist[i].probability + "#" + can_refresh_numbners + "#" + ConfigSystem.dark_weblist[i].darkWebTimesCT + "#" + ConfigSystem.dark_weblist[i].wvType; - // } + dark_str += ConfigSystem.dark_weblist[i].webLink + "#" + ConfigSystem.dark_weblist[i].probability + "#" + can_refresh_numbners + "#" + ConfigSystem.dark_weblist[i].darkWebTimesCT + "#" + ConfigSystem.dark_weblist[i].wvType + "#" + ConfigSystem.dark_weblist[i].darkWebTimesCT2; + } - // string darkWVRefreshtime_str = ""; + string darkWVRefreshtime_str = ""; - // for (int i = 0; i < ConfigSystem.GetConfig().darkWVRefreshtime.Length; i++) - // { - // if (i != 0) darkWVRefreshtime_str += "|"; - // darkWVRefreshtime_str += ConfigSystem.GetConfig().darkWVRefreshtime[i].ToString(); - // } + for (int i = 0; i < ConfigSystem.GetConfig().darkWVRefreshtime.Length; i++) + { + if (i != 0) darkWVRefreshtime_str += "|"; + darkWVRefreshtime_str += ConfigSystem.GetConfig().darkWVRefreshtime[i].ToString(); + } // for (int i = 0; i < ConfigSystem.GetConfig().darkWVRefreshtime2.Length; i++) // { // darkWVRefreshtime_str += "|"; // darkWVRefreshtime_str += ConfigSystem.GetConfig().darkWVRefreshtime2[i].ToString(); // } - // Debug.Log("--------------------------------"); + Debug.Log("--------------------------------"); - // string add_time = ConfigSystem.GetConfig().WVClickCTAddTime1[0] + "|" + - // ConfigSystem.GetConfig().WVClickCTAddTime1[1] + "|" + ConfigSystem.GetConfig().WVClickCTAddTime2[0] + "|" + ConfigSystem.GetConfig().WVClickCTAddTime2[1]; + string add_time = ConfigSystem.GetConfig().WVClickAddTime[0] + "|" + ConfigSystem.GetConfig().WVClickAddTime[1]; - // Debug.Log(add_time); - // WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig().flyCtRate, ConfigSystem.GetConfig().otherH5switch, - // ConfigSystem.GetConfig().H5Refreshtime, Dailyrefresh_reamain, ConfigSystem.GetConfig().darkThoughProbability - // , darkWVRefreshtime_str, darkWVDailyrefreshtimes_str, dark_str, light_str, GameHelper.IsGiftSwitch(), ConfigSystem.web_through_str, add_time); + Debug.Log(add_time); + WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig().flyCtRate, ConfigSystem.GetConfig().otherH5switch, + ConfigSystem.GetConfig().H5Refreshtime, Dailyrefresh_reamain, ConfigSystem.GetConfig().darkThoughProbability + , darkWVRefreshtime_str, darkWVDailyrefreshtimes_str, dark_str, light_str, GameHelper.IsGiftSwitch(), ConfigSystem.web_through_str, add_time); // WebviewManager.Instance.OpenWebView(gameUrlInfo.webLink); //WebviewManager.Instance.setFlyCtRate(ConfigSystem.GetConfig().flyCtRate); // RefreshDataCT(isTop, gameUrlInfo); } + public void ClickAdEvent(string ad_msg) { string[] temp_array = ad_msg.Split("|");