h5sdk提交

This commit is contained in:
2026-07-06 16:31:08 +08:00
parent 761e670f01
commit 3c0298f19f
1183 changed files with 107360 additions and 42666 deletions
+129 -7
View File
@@ -249,7 +249,7 @@ namespace BingoBrain
{
case 101:
{
if (UI.Instance.GetDynamicUI(UIConst.BingoHallUI) is BingoHallUI topUI2)
if (UI.Instance.GetDynamicUI(UIConst.SmailUI) is SmailUI topUI2)
{
gObject = topUI2.ui.btn_coin;
}
@@ -261,7 +261,7 @@ namespace BingoBrain
break;
case 102:
{
if (UI.Instance.GetDynamicUI(UIConst.BingoHallUI) is BingoHallUI topUI2)
if (UI.Instance.GetDynamicUI(UIConst.SmailUI) is SmailUI topUI2)
{
gObject = topUI2.ui.btn_cash;
}
@@ -394,8 +394,8 @@ namespace BingoBrain
public static bool IsGiftSwitch()
{
return false;
// return true;
// return false;
// return true; //zhushi
// Debug.Log(GetLoginModel().is_magic);
return GetLoginModel().is_magic;
}
@@ -586,7 +586,30 @@ namespace BingoBrain
return $"{currency102:N}";
}
}
public static string Get102Str_new(decimal currency102 = -1)
{
if (currency102 == -1)
{
currency102 = PreferencesMgr.Instance.Currency102;
}
if (IsGiftSwitch())
{
if (isRDExchangeMode())
{
return $"{currency102:N}";
}
else
{
return $"${currency102:N}";
}
}
else
{
currency102 = (int)currency102;
return $"{currency102:N0}";
}
}
public static T GetConfig<T>()
{
return ConfigSystem.GetConfig<T>();
@@ -682,6 +705,7 @@ namespace BingoBrain
public static AdReward GetChanceByIdAndNum(int id, int num = 0)
{
if (id == 102) id = 101;
var adRewardModel = GetConfig<AdRewardModel>();
return adRewardModel.GetDataList().FirstOrDefault(vo =>
vo.reward == id && (vo.rewardAmount == 0 || vo.rewardAmount == num));
@@ -1069,7 +1093,7 @@ namespace BingoBrain
public static int GetLevel()
{
//return 30;
return 30; //zhushi
return PlayerPrefs.GetInt("_level", 1);
}
@@ -1164,8 +1188,9 @@ namespace BingoBrain
look_interad_numbers = 0;
if (UnityEngine.Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().interstitialtype)
{
if (UI.Instance.IsExistUI(UIConst.H5UI)) GameHelper.ShowInterstitial("interstitial_h5reward");
else UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AdcomingUI_Open);
// if (UI.Instance.IsExistUI(UIConst.H5UI)) GameHelper.ShowInterstitial("interstitial_h5reward");
// else UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AdcomingUI_Open);
GameHelper.ShowInterstitial("interstitial_Ad");
}
}
}
@@ -1632,6 +1657,103 @@ namespace BingoBrain
return oldDate > yesterday;
}
public static bool isRDExchangeMode()
{
// return false;//zhushi
//return true;//zhushi
return SaveData.GetSaveobject().ExchangeModeToggle == 1;
}
public static string getDesByKey(string key)
{
Debug.Log(key);
Debug.Log(JsonConvert.SerializeObject(ConfigSystem.GetConfig<ExchangeDesModel>().dataList));
if (isRDExchangeMode())
{
string str = ConfigSystem.GetConfig<ExchangeDesModel>().dataList.FirstOrDefault(data => data.des_key == key)?.Mode_1 ?? "";
if (str != "")
{
str = str.Replace("<img1>", "<img src='ui://pmf3wbji112epi7'/>")
.Replace("<img2>", "<img src='ui://o9974uc5t9w7c3'/>");
}
return str;
}
else
{
return ConfigSystem.GetConfig<ExchangeDesModel>().dataList.FirstOrDefault(data => data.des_key == key)?.Mode_0 ?? "";
}
}
public static string getChString(decimal ch)
{
if (GameHelper.isRDExchangeMode())
{
string str = "<img src='ui://pmf3wbji112epi7'/>";
return str + $" {ch:N}";
}
else
{
return $"${ch:N}";
}
}
public static string GenerateUniqueKey()
{
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
string key;
do
{
StringBuilder sb = new StringBuilder();
sb.Append(GenerateRandomString(chars, 4));
sb.Append("-");
sb.Append(GenerateRandomString(chars, 6));
sb.Append("-");
sb.Append(GenerateRandomString(chars, 4));
key = sb.ToString();
} while (generatedKeys.Contains(key)); // 如果重复就重新生成
generatedKeys.Add(key); // 添加到集合中
return key;
}
static string GenerateRandomString(string charSet, int length)
{
StringBuilder sb = new StringBuilder();
System.Random random = new System.Random();
for (int i = 0; i < length; i++)
{
int index = random.Next(charSet.Length);
sb.Append(charSet[index]);
}
return sb.ToString();
}
private static HashSet<string> generatedKeys = new HashSet<string>();
public static string getPrice(decimal ch)
{
return $"${ch:N}";
}
public static string GetPriceInt(decimal ch)
{
return $"${ch:N0}";
}
public static void CopyText(string text)
{
#if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX
GUIUtility.systemCopyBuffer = text;
#elif UNITY_ANDROID
// CopyToClipboardAndroid(text);
#elif UNITY_IOS
BrigdeIOS.copyText(text);
#else
Debug.LogWarning("当前平台不支持复制到剪贴板功能");
#endif
GameHelper.ShowTips("Copy Succeed");
}
public static void LoadSceneAsync(int level)
{
UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("scene_" + level);
}
}
}