fix:1、添加h5.2、修复bug
This commit is contained in:
@@ -91,6 +91,7 @@ namespace IgnoreOPS
|
||||
public int[] WVOffset;
|
||||
|
||||
public string X_Redeemcode;
|
||||
public string X_ShopURL;
|
||||
|
||||
|
||||
public CommonModel(string key) : base(key)
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace IgnoreOPS
|
||||
public int Active_time;
|
||||
public int Active_time_Down;
|
||||
public int Active_Limit_times;
|
||||
public string[] T_Redeemcode;
|
||||
public string T_ShopURL;
|
||||
}
|
||||
|
||||
public class MakeupModel_2 : ConfigModel<MakeupModel_2, Makeup_2>
|
||||
@@ -63,5 +65,7 @@ namespace IgnoreOPS
|
||||
public int Reset_time;
|
||||
public float ADIncrease;
|
||||
public int PayIncrease;
|
||||
public string[] C_Redeemcode;
|
||||
public string C_ShopURL;
|
||||
}
|
||||
}
|
||||
@@ -1340,7 +1340,7 @@ namespace ChillConnect
|
||||
{
|
||||
if (RainPlayUI == null)
|
||||
{
|
||||
RainPlayUI = GameObject.Find("(RainPlayUI)sheep_play");
|
||||
RainPlayUI = GameObject.Find("(ArrowGameUI)com_arrow_game");
|
||||
}
|
||||
|
||||
if (RainPlayUI != null)
|
||||
@@ -1636,28 +1636,33 @@ namespace ChillConnect
|
||||
// return true; //zhushi
|
||||
return SaveData.GetSaveObject().ExchangeModeToggle == 1;
|
||||
}
|
||||
private static HashSet<string> generatedKeys = new HashSet<string>();
|
||||
public static string GenerateUniqueKey()
|
||||
// private static HashSet<string> generatedKeys = new HashSet<string>();
|
||||
public static string GenerateUniqueKey(Makeup vo, int index)
|
||||
{
|
||||
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
string key;
|
||||
do
|
||||
// 处理数组为空的边界情况
|
||||
if (vo.T_Redeemcode == null || vo.T_Redeemcode.Length == 0)
|
||||
{
|
||||
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;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
// 如果 index 超出范围,取最后一个元素;否则直接返回对应索引的元素
|
||||
int validIndex = index >= 0 && index < vo.T_Redeemcode.Length ? index : vo.T_Redeemcode.Length - 1;
|
||||
return vo.T_Redeemcode[validIndex];
|
||||
}
|
||||
|
||||
public static string GenerateUniqueKey1(Makeup_2 vo, int index)
|
||||
{
|
||||
// 处理数组为空的边界情况
|
||||
if (vo.C_Redeemcode == null || vo.C_Redeemcode.Length == 0)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
// 如果 index 超出范围,取最后一个元素;否则直接返回对应索引的元素
|
||||
int validIndex = index >= 0 && index < vo.C_Redeemcode.Length ? index : vo.C_Redeemcode.Length - 1;
|
||||
return vo.C_Redeemcode[validIndex];
|
||||
}
|
||||
|
||||
static string GenerateRandomString(string charSet, int length)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using DG.Tweening;
|
||||
using IgnoreOPS;
|
||||
using SGModule.Net;
|
||||
using UNSDK;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
@@ -28,12 +29,12 @@ namespace ChillConnect
|
||||
private WindowSystem windowSys;
|
||||
private RewardSystem rewardSys;
|
||||
private ConsumeSystem consumeSys;
|
||||
|
||||
|
||||
private bool isFirstEnter = true;
|
||||
public int enterHallTimes = 0;
|
||||
public bool isShowRankView = false;
|
||||
public event Action UpdateEvent;
|
||||
|
||||
private Camera _gameCamera;
|
||||
|
||||
// public int countTimes = 0;
|
||||
|
||||
@@ -44,6 +45,8 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.AddListener(GameMsg.BackMainScene, EnterHall);
|
||||
|
||||
AppDispatcher.Instance.AddListener(MainThreadMsg.App_Focus_True, BackToGame);
|
||||
CtrlDispatcher.Instance.AddListener(CtrlMsg.open_wb, OpenWb);
|
||||
|
||||
SetSoundVolume();
|
||||
InitSystem();
|
||||
}
|
||||
@@ -165,6 +168,41 @@ namespace ChillConnect
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void OpenWb(object obj) {
|
||||
|
||||
if (obj is not SDKOpenConfig openConfig) return;
|
||||
|
||||
SdkConfigMgr.Instance.Open(openConfig.normal, openConfig.url);
|
||||
SetCameraVisible(false);
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open, false);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
||||
}
|
||||
|
||||
public void SetCameraVisible(bool visible)
|
||||
{
|
||||
// 只在首次调用时查找
|
||||
if (_gameCamera == null)
|
||||
{
|
||||
// 使用 FindWithTag 确保能找到非激活对象
|
||||
|
||||
_gameCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
|
||||
}
|
||||
if (_gameCamera != null)
|
||||
{
|
||||
_gameCamera.enabled = visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("GameCamera reference not found!");
|
||||
}
|
||||
|
||||
GameHelper.ShowSheepPlayUI(visible);
|
||||
}
|
||||
|
||||
#region 缓存资源
|
||||
|
||||
public void GetGalleryNet(int imageID, Action<bool> action = null)
|
||||
|
||||
Reference in New Issue
Block a user