fix:1、修复bug

This commit is contained in:
2026-07-14 17:56:40 +08:00
parent bb84cea894
commit 447c7b7bc7
17 changed files with 71 additions and 77 deletions
+35 -35
View File
@@ -23,40 +23,6 @@ public class FreeWebViewManager : MonoBehaviour
}
public void initView()
{
if (_webObj != null) return;
// 创建WebView对象
_webObj = new GameObject("WebViewObject1");
_webView = _webObj.AddComponent<WebViewObject1>();
// 关键:开启WKWebView,规避苹果审核拒绝
_webView.Init(
enableWKWebView: true,
cb: OnWebMessage // JS调用Unity回调
);
float top_offset = 0;//fgui中的顶部信息的高度
float buttom_offset = 155;
if (Screen.safeArea.y != 0)
{//刘海屏
top_offset += Screen.safeArea.y;
}
// 铺满屏幕,适配刘海安全区
_webView.SetMargins(0, (int)top_offset, 0, (int)buttom_offset);
// 禁止下拉回弹(可选)
_webView.SetScrollBounceEnabled(false);
_webView.LoadURL("about:blank");
_webView.SetVisibility(false);
}
/// <summary>
/// 打开网页
/// </summary>
public void OpenWeb(string url)
{
// if (_webObj != null) return;
//
@@ -82,6 +48,40 @@ public class FreeWebViewManager : MonoBehaviour
// // 禁止下拉回弹(可选)
// _webView.SetScrollBounceEnabled(false);
//
// _webView.LoadURL("about:blank");
// _webView.SetVisibility(false);
//
}
/// <summary>
/// 打开网页
/// </summary>
public void OpenWeb(string url)
{
if (_webObj != null) return;
// 创建WebView对象
_webObj = new GameObject("WebViewObject1");
_webView = _webObj.AddComponent<WebViewObject1>();
// 关键:开启WKWebView,规避苹果审核拒绝
_webView.Init(
enableWKWebView: true,
cb: OnWebMessage // JS调用Unity回调
);
float top_offset = 0;//fgui中的顶部信息的高度
float buttom_offset = 155;
if (Screen.safeArea.y != 0)
{//刘海屏
top_offset += Screen.safeArea.y;
}
// 铺满屏幕,适配刘海安全区
_webView.SetMargins(0, (int)top_offset, 0, (int)buttom_offset);
// 禁止下拉回弹(可选)
_webView.SetScrollBounceEnabled(false);
// 加载网页并显示
_webView.LoadURL(url);
_webView.SetVisibility(true);
@@ -107,7 +107,7 @@ public class FreeWebViewManager : MonoBehaviour
{
if (_webObj != null)
{
_webView.SetVisibility(false);
OnDestroy();
}
}
@@ -408,7 +408,7 @@ namespace RedHotRoast
{
decimal coin = DataMgr.Ticket.Value;
coin *= (decimal)GameHelper.GetExchangeRateVo().Multi;
// coin *= (decimal)GameHelper.GetExchangeRateVo().Multi;
if (ui.com_money is com_money comMoney) comMoney.text_gold.text = coin.ToString("0.00");
}
@@ -235,7 +235,7 @@ namespace RedHotRoast
}
}
ui.btn_gold.GetChild("text_gold").text = $"{DataMgr.Coin.Value:N0}";
ui.top_money.GetChild("text_gold").text = GameHelper.Get102Str(DataMgr.Ticket.Value);
ui.top_money.GetChild("text_gold").text = $"{DataMgr.Ticket.Value:N}";
ui.btn_mult.SetClick(() =>
{
// if (!GameHelper.GetCloseResult())
@@ -344,7 +344,7 @@ namespace RedHotRoast
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
DOVirtual.DelayedCall(1, () =>
{
DOVirtual.Float(0, (float)DataMgr.Ticket.Value * GameHelper.GetExchangeRateVo().Multi, 1,
DOVirtual.Float(0, (float)DataMgr.Ticket.Value , 1,
value => { ui.top_money.GetChild("text_gold").text = ((decimal)value).ToString("0.00"); });
});
}