fix:1、添加H5
This commit is contained in:
@@ -2,11 +2,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
public class BrigdeIOS
|
||||
{
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void DakaiACT();
|
||||
[DllImport("__Internal")]
|
||||
public static extern void ShezhiACT(bool though);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void copyText(string text);
|
||||
[DllImport("__Internal")]
|
||||
@@ -15,4 +11,57 @@ public class BrigdeIOS
|
||||
public static extern void SaveImageWithCustomDate(string imagePath);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void TrackProduct(string eventName, string dictionaryJson);
|
||||
|
||||
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void OpenWebview(string url);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void CloseWebview();
|
||||
[DllImport("__Internal")]
|
||||
public static extern void showDarkWebview();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetFullScreen();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void addH5Field(int field1, int field2, int field3, int field4, int field5, string field6, string field7, string dark_url, string light_url, bool is_gift, string web_through_str, string click_add_time);
|
||||
// [DllImport("__Internal")]
|
||||
// public static extern void SetTouchWebview(bool flag, bool force = false);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// public static extern void ScrollWebview(float dx, float dy);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetPadding(float left, float top, float right, float bottom);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetDarkThough(bool though);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetBtn(int left, int top, int right, int bottom);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetCTEnable(bool flag);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void ShowH5View(bool flag);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetIconProgress(float val);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetClickView();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void ShowFlyBtn(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void setInH5View(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void upDataH5times(string weblink, int times, bool is_dark);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void setFlyBtnTag(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void setRewardBtnTag(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetOffset(int offset_y ,int offset_y2);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// #if UNITY_EDITOR
|
||||
// #endif
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using DG.Tweening;
|
||||
using DontConfuse;
|
||||
using FairyGUI;
|
||||
using IgnoreOPS;
|
||||
// using SGModule.ApplePay;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace RedHotRoast
|
||||
@@ -104,6 +106,34 @@ namespace RedHotRoast
|
||||
ShowScene();
|
||||
SaveingPotHelper.CheckSaveingPot();
|
||||
SaveingPotHelper.TestingClearTime();
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
WebviewManager.Instance.SetFullScreen();
|
||||
int flyswitch = ConfigSystem.GetCommonConf().flyswitch;
|
||||
int propswitch = ConfigSystem.GetCommonConf().propswitch;
|
||||
|
||||
int offset_y = ConfigSystem.GetCommonConf().WVOffset[0];
|
||||
int offset_y1 = ConfigSystem.GetCommonConf().WVOffset[1];
|
||||
Debug.Log("barry offset_y: " + offset_y + " offset_y1: " + offset_y1);
|
||||
float top_offset = 0;//fgui中的顶部信息的高度
|
||||
float buttom_offset = 155;
|
||||
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(true);
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
WebviewManager.Instance.SetBtn(ConfigSystem.GetCommonConf().propCoord[0], ConfigSystem.GetCommonConf().propCoord[1], 60, 60);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace RedHotRoast
|
||||
moduleManager.AddModel(ModelConst.UnlockLevelNewModel, new UnlockLevelNewModel());
|
||||
moduleManager.AddModel(ModelConst.BroadcastModel, new BroadcastModel());
|
||||
moduleManager.AddModel(ModelConst.EggViewModel, new EggViewModel());
|
||||
moduleManager.AddModel(ModelConst.H5Model, new H5Model());
|
||||
}
|
||||
public static void AutoRegisterUICtrl()
|
||||
{
|
||||
@@ -134,6 +135,7 @@ namespace RedHotRoast
|
||||
moduleManager.AddUICtrl(UICtrlConst.UnlockLevelNewUICtrl, new UnlockLevelNewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.BroadcastUICtrl, new BroadcastUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.EggViewUICtrl, new EggViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.H5UICtrl, new H5UICtrl());
|
||||
}
|
||||
|
||||
public static void AutoRegisterCtrl()
|
||||
@@ -208,6 +210,7 @@ namespace RedHotRoast
|
||||
moduleManager.AddCtrl(CtrlConst.UnlockLevelNewCtrl, new UnlockLevelNewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.BroadcastCtrl, new BroadcastCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.EggViewCtrl, new EggViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.H5Ctrl, new H5Ctrl());
|
||||
}
|
||||
|
||||
public static void AutoRegisterUIType()
|
||||
@@ -279,6 +282,7 @@ namespace RedHotRoast
|
||||
moduleManager.AddUIType(UIConst.UnlockLevelNewUI, typeof(UnlockLevelNewUI));
|
||||
moduleManager.AddUIType(UIConst.BroadcastUI, typeof(BroadcastUI));
|
||||
moduleManager.AddUIType(UIConst.EggViewUI, typeof(EggViewUI));
|
||||
moduleManager.AddUIType(UIConst.H5UI, typeof(H5UI));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ using UnityEngine;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using DontConfuse;
|
||||
|
||||
namespace RedHotRoast
|
||||
|
||||
{
|
||||
@@ -61,6 +63,7 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
foreach (var t in loader_list)
|
||||
if (t != null && !t.isDisposed && t.texture != null)
|
||||
{
|
||||
@@ -98,6 +101,7 @@ namespace RedHotRoast
|
||||
public SmartInvoker invoker;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
invoker = new SmartInvoker(() =>
|
||||
{
|
||||
for (int i = 0; i < UpDatatime.Length; i++)
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace RedHotRoast
|
||||
{
|
||||
ChatHelper.chat_red_list[chat_index] = false;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshRedDot);
|
||||
UnityManager.ShezhiACT(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -79,7 +78,6 @@ namespace RedHotRoast
|
||||
{
|
||||
GameHelper.ShowTips("launching_soon", true);
|
||||
});
|
||||
UnityManager.ShezhiACT(false);
|
||||
}
|
||||
public static bool IsSameDay(long timestamp)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9795db4075134685acdc143801219dd6
|
||||
timeCreated: 1779352795
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
using RedHotRoast;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class H5Ctrl : BaseCtrl
|
||||
{
|
||||
public static H5Ctrl Instance { get; private set; }
|
||||
|
||||
private H5Model model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.H5Model) as H5Model;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f0d89ff894a1074494420d446333bfc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
using RedHotRoast;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class H5Model : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ad9b45c44f492b4a97fc9845e2972a8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,249 @@
|
||||
|
||||
using DontConfuse;
|
||||
using FGUI.ZM_H5_15;
|
||||
using RedHotRoast;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class H5UI : BaseUI
|
||||
{
|
||||
private H5UICtrl ctrl;
|
||||
private H5Model model;
|
||||
private com_webview ui;
|
||||
|
||||
public H5UI(H5UICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.H5UI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_H5_15";
|
||||
uiInfo.assetName = "com_webview";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.H5Model) as H5Model;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
|
||||
WebviewManager.Instance.setInH5View(false);
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_H5_15.com_webview;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
WebviewManager.Instance.setInH5View(true);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
||||
// delayedCall = DOVirtual.DelayedCall(0.3f, () =>
|
||||
// {
|
||||
WebviewManager.Instance.ShowH5View(true);
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Close);
|
||||
});
|
||||
InitView();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
}
|
||||
public void ClickBtn(string name)
|
||||
{
|
||||
// // Debug.Log("[UNITY] Click btn: " + name);
|
||||
// FGUIHelper.PlayClickSound();
|
||||
if (name == "flyBtn")
|
||||
{
|
||||
OnClickFlyCash();
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.collect_fly_people,1);
|
||||
|
||||
TrackKit.SendEvent(HallBehaviorTrack.Event, HallBehaviorTrack.Property.collect_fly_number);
|
||||
|
||||
}
|
||||
else if (name == "rewardBtn")
|
||||
{
|
||||
OnClickIcon();
|
||||
|
||||
}
|
||||
}
|
||||
private void OnClickFlyCash()
|
||||
{
|
||||
// PreferencesMgr.Instance.AdCashFlyShowTime =
|
||||
// GameHelper.GetNowTime() + ConfigSystem.GetConfig<CommonModel>().flyCD;
|
||||
// var rewardData = new RewardData();
|
||||
|
||||
// var singleValue =
|
||||
// (decimal)Math.Round(
|
||||
// UnityEngine.Random.Range(ConfigSystem.GetConfig<CommonModel>().flyReward[0],
|
||||
// ConfigSystem.GetConfig<CommonModel>().flyReward[1]), 2);
|
||||
|
||||
|
||||
// decimal rewardValue;
|
||||
|
||||
|
||||
// if (flyClickCount >= flyNeedClickCount)
|
||||
// {
|
||||
// flyClickCount = -1;
|
||||
// //var rate = GameHelper.GetVideoRate();
|
||||
// rewardValue = singleValue;
|
||||
// GameHelper.ShowVideoAd("reward_fly", isCompleted =>
|
||||
// {
|
||||
// if (isCompleted)
|
||||
// {
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// rewardValue = singleValue;
|
||||
// }
|
||||
|
||||
// var startPosition = GameHelper.GetUICenterPosition(ui.com_fly);
|
||||
// var endPosition = GameHelper.GetUICenterPosition(ui.com_top.text_num);
|
||||
|
||||
// var rewardSingleData = new RewardSingleData(102, rewardValue, RewardOrigin.H5Fly101)
|
||||
// {
|
||||
// startPosition = startPosition,
|
||||
// endPosition = new Vector2(endPosition.x - 150, endPosition.y - 106)
|
||||
// };
|
||||
|
||||
// rewardData.AddReward(rewardSingleData);
|
||||
// rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
// rewardData.AddCompleted(isSuccess =>
|
||||
// {
|
||||
// if (isSuccess)
|
||||
// {
|
||||
// flyClickCount++;
|
||||
// }
|
||||
|
||||
// SetMakeup();
|
||||
// });
|
||||
// //GameHelper.addMoney((float)rewardValue);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
// CheckShowFly();
|
||||
}
|
||||
private void OnClickIcon()
|
||||
{
|
||||
// //WebThroughUtil.WebThroughClick(H5WebThroughType.OnlineH5, ui.btn_icon);
|
||||
// if (iconTime < ConfigSystem.GetConfig<CommonModel>().ThroughRewardCD)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// #if UNITY_IOS && !UNITY_EDITOR
|
||||
// WebviewManager.Instance.ShowH5View(false);
|
||||
// #endif
|
||||
|
||||
// float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
|
||||
// // var temp = new { is_success = true, cash_number = cash_array[0], rate = cash_array[1], is_level_success = false, is_h5_reward = true };
|
||||
// SuccessData temp = new SuccessData();
|
||||
// temp.IsWin = true;
|
||||
// temp.cash_number = cash_array[0];
|
||||
// temp.rate = (int)cash_array[1];
|
||||
// temp.IsLevelSuccess = false;
|
||||
// temp.IsH5Reward = true;
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
|
||||
// //UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RewardUI_Open);
|
||||
// // var rewardData = new RewardData();
|
||||
|
||||
// // var rewardType = 111;
|
||||
// // decimal rewardValue = (decimal)GameHelper.GetRewardValue(3)[0];
|
||||
|
||||
// // var rewardSingleData = new RewardSingleData(rewardType, rewardValue, RewardOrigin.H5Icon)
|
||||
// // {
|
||||
// // startPosition = GameHelper.GetUICenterPosition(ui.btn_icon),
|
||||
// // endPosition = GameHelper.GetUICenterPosition(ui.com_top.text_num)
|
||||
// // };
|
||||
// // rewardData.AddReward(rewardSingleData);
|
||||
// // rewardData.AddCompleted(isSuccess =>
|
||||
// // {
|
||||
// // ui.btn_icon.cont_state.selectedIndex = btn_icon.State_none;
|
||||
// // iconTime = 0;
|
||||
// // SetMakeup();
|
||||
// // });
|
||||
// // rewardData.condition = RewardCondition.AD;
|
||||
// // rewardData.displayType =
|
||||
// // RewardDisplayType.Dialog | RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
|
||||
// // GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
|
||||
// // GameHelper.addMoney((float)rewardValue);
|
||||
// // GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
// // GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
|
||||
|
||||
// iconTime = 0;
|
||||
// // SetMakeup();
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_get_number, 1);
|
||||
}
|
||||
private void CheckShowFly()
|
||||
{
|
||||
// var nowTime = GameHelper.GetNowTime();
|
||||
// var leftTime = (int)(PreferencesMgr.Instance.AdCashFlyShowTime - nowTime);
|
||||
|
||||
// ui.com_fly.visible = false;
|
||||
// ui.com_fly.visible = leftTime <= 0;
|
||||
// if (leftTime > 0)
|
||||
// {
|
||||
// WebviewManager.Instance.ShowFlyBtn(false);
|
||||
// isFlyShow = false;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //StartFly();
|
||||
// if (!isFlyShow) WebviewManager.Instance.ShowFlyBtn(true);
|
||||
// isFlyShow = true;
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 345404ec69f13b84c9ce0415061b717b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
|
||||
using RedHotRoast;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class H5UICtrl : BaseUICtrl
|
||||
{
|
||||
private H5UI ui;
|
||||
private H5Model model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.H5UI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.H5UI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.H5Model) as H5Model;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new H5UI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
}
|
||||
public override uint GetCloseUIMsg(string uiName)
|
||||
{
|
||||
return closeUIMsg;
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
|
||||
gameDispatcher.AddListener(GameMsg.H5ViewClickBtn, OnH5ClickBtn);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
gameDispatcher.RemoveListener(GameMsg.H5ViewClickBtn, OnH5ClickBtn);
|
||||
}
|
||||
void OnH5ClickBtn(object arg)
|
||||
{
|
||||
ui?.ClickBtn((string)arg);
|
||||
}
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74ecd6e2beb102e4e9eee8ad48c987d6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -16,6 +16,7 @@ using System.Net;
|
||||
using SGModule.Net;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using DontConfuse;
|
||||
|
||||
|
||||
namespace RedHotRoast
|
||||
@@ -209,6 +210,9 @@ namespace RedHotRoast
|
||||
}
|
||||
void Setbg(object a = null)
|
||||
{
|
||||
return;
|
||||
|
||||
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
{
|
||||
return;
|
||||
@@ -483,6 +487,13 @@ namespace RedHotRoast
|
||||
ui.btn_shop.SetClick(OnClickShop);
|
||||
// ui.btn_secret.SetClick(OnClickSecretAlbums);
|
||||
ui.btn_vip.SetClick(onClickVip);
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
ui.btn_wv.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open);
|
||||
});
|
||||
|
||||
ui.btn_egg.SetClick(OnClickEgg);
|
||||
btn_noads.SetClick(() =>
|
||||
@@ -546,6 +557,12 @@ namespace RedHotRoast
|
||||
|
||||
});
|
||||
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
}
|
||||
|
||||
|
||||
// ui.btn_task_times.SetClick(() => { OnClickTask(false); });
|
||||
|
||||
ui.btn_task.SetClick(() => { OnClickTask(false); });
|
||||
@@ -581,7 +598,7 @@ namespace RedHotRoast
|
||||
ui.state.selectedIndex = GameHelper.IsGiftSwitch() ? 1 : 0;
|
||||
ui.btn_three_day.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
});
|
||||
for (int i = 0; i < BtnNum; i++)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using DontConfuse;
|
||||
|
||||
// using System.IO;
|
||||
|
||||
@@ -91,6 +92,7 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
// 归还所有播放器
|
||||
foreach (var kvp in dictionary_)
|
||||
VideoPlayerPool.Instance.ReturnPlayer(kvp.Value);
|
||||
@@ -123,6 +125,8 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
LiveConfig = ConfigSystem.GetLiveConfig();
|
||||
|
||||
ui.list_.itemRenderer = RendererList;
|
||||
|
||||
@@ -4,6 +4,7 @@ using FairyGUI;
|
||||
using FGUI.ZM_Tasks_13;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using DontConfuse;
|
||||
using FGUI.ZM_Common_01;
|
||||
|
||||
namespace RedHotRoast
|
||||
@@ -52,7 +53,8 @@ namespace RedHotRoast
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -67,6 +69,8 @@ namespace RedHotRoast
|
||||
ui.gold.y += Screen.safeArea.y;
|
||||
}
|
||||
CommonHelper.CheckAdTimes();
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using FairyGUI;
|
||||
using FGUI.ZM_Pass_14;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using DontConfuse;
|
||||
using FGUI.ZM_Common_01;
|
||||
using Spine.Unity;
|
||||
|
||||
@@ -41,6 +42,9 @@ namespace RedHotRoast {
|
||||
protected override void OnClose() {
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= upData;
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -57,6 +61,8 @@ namespace RedHotRoast {
|
||||
// ui.top_bg.height += Screen.safeArea.y;
|
||||
ui.group_.y += 66;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
|
||||
if (GameHelper.GetGameday() != DateTime.Now.Day) {
|
||||
DataMgr.GameTime.Value = 0;
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace RedHotRoast
|
||||
protected override void OnClose()
|
||||
{
|
||||
CommonHelper.FadeOut(ui);
|
||||
UnityManager.ShezhiACT(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +57,6 @@ namespace RedHotRoast
|
||||
// ui.title.y += Screen.safeArea.y;
|
||||
// }
|
||||
selectIndex = DataMgr.PlayerAvatarId.Value;
|
||||
UnityManager.ShezhiACT(false);
|
||||
InitView();
|
||||
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace RedHotRoast
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
ui.group_.y += Screen.safeArea.y - 15;
|
||||
ui.btn_wv.y += 20;
|
||||
}
|
||||
GameHelper.IsShowFirstReward();
|
||||
ui.gift_switch.selectedIndex = GameHelper.IsGiftSwitch() ? 1 : 0;
|
||||
@@ -442,6 +443,11 @@ namespace RedHotRoast
|
||||
ui.btn_refresh.SetClick(RefreshFunc);
|
||||
|
||||
|
||||
ui.btn_wv.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open);
|
||||
});
|
||||
|
||||
ui.btn_back.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 1);
|
||||
@@ -581,7 +587,7 @@ namespace RedHotRoast
|
||||
|
||||
ui.btn_three_day.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
});
|
||||
ui.btn_look_ad.SetClick(() => { LookAd(); });
|
||||
Setbg();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using DontConfuse;
|
||||
using SGModule.MarkdownKit;
|
||||
|
||||
namespace RedHotRoast
|
||||
@@ -42,6 +43,9 @@ namespace RedHotRoast
|
||||
protected override void OnClose()
|
||||
{
|
||||
ui?.FadeOut();
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -58,6 +62,8 @@ namespace RedHotRoast
|
||||
|
||||
}
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
InitView();
|
||||
|
||||
ui.show.selectedIndex = isTerm != 2 ? 0 : 1;
|
||||
|
||||
@@ -6,6 +6,7 @@ using FairyGUI;
|
||||
using FGUI.ZM_Common_01;
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using DontConfuse;
|
||||
using FGUI.bkg_jilu;
|
||||
using SGModule.Common.Extensions;
|
||||
using Unity.VisualScripting;
|
||||
@@ -42,6 +43,8 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
if (coroutine != null)
|
||||
{
|
||||
CrazyAsyKit.StopCoroutine(coroutine);
|
||||
@@ -55,6 +58,9 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
InitView();
|
||||
|
||||
ui.btn_close.onClick.Add(() =>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using DontConfuse;
|
||||
using Spine.Unity;
|
||||
|
||||
namespace RedHotRoast
|
||||
@@ -44,6 +45,11 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
if (UIManager.Instance.IsExistUI(UIConst.H5UI))
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
tween?.Kill();
|
||||
CommonHelper.FadeOut(ui);
|
||||
}
|
||||
@@ -56,6 +62,11 @@ namespace RedHotRoast
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
if (UIManager.Instance.IsExistUI(UIConst.H5UI))
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
}
|
||||
|
||||
InitData();
|
||||
InitView();
|
||||
ui.btn_null.SetClick(() => { });
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using DontConfuse;
|
||||
using FairyGUI;
|
||||
using FGUI.LG_secretAlbums;
|
||||
using SGModule.NetKit;
|
||||
@@ -277,6 +278,7 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
// 1. 解除 UI 对 Loader 的引用
|
||||
for (var i = 0; i < ui.sc_list.numChildren; i++)
|
||||
{
|
||||
@@ -312,6 +314,7 @@ namespace RedHotRoast
|
||||
ui.sc_list.y += 38;
|
||||
}
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
var eventName = GameHelper.IsAdModelOfPay() ? ADEventTrack.Event : ADEventTrack.MaxPayEvent;
|
||||
TrackKit.SendEvent(eventName, ADEventTrack.Property.shop_show);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using DontConfuse;
|
||||
using FairyGUI;
|
||||
using FGUI.LG_secretAlbums;
|
||||
using SGModule.Common.Helper;
|
||||
@@ -41,6 +42,8 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent -= UpWatchAdsBtn;
|
||||
|
||||
// 清理 Loader 的材质和贴图
|
||||
@@ -80,6 +83,8 @@ namespace RedHotRoast
|
||||
{
|
||||
if (args == null) return;
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
_albumPreviewData = (AlbumPreviewData)args;
|
||||
|
||||
InitView();
|
||||
|
||||
@@ -4,6 +4,7 @@ using FairyGUI;
|
||||
using FGUI.ZM_store_17;
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using DontConfuse;
|
||||
using FGUI.ZM_Common_01;
|
||||
using SGModule.NetKit;
|
||||
using Spine.Unity;
|
||||
@@ -44,6 +45,8 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= initList;
|
||||
HallManager.Instance.UpdateSecondEvent -= upWatchAdsBtn;
|
||||
@@ -71,6 +74,8 @@ namespace RedHotRoast
|
||||
//刘海屏
|
||||
ui.top_gold.y += Screen.safeArea.y - 15;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
|
||||
var eventName = GameHelper.IsAdModelOfPay() ? ADEventTrack.Event : ADEventTrack.MaxPayEvent;
|
||||
TrackKit.SendEvent(eventName, ADEventTrack.Property.shop_show);
|
||||
|
||||
@@ -10,6 +10,7 @@ using Newtonsoft.Json;
|
||||
// using SGModule.ApplePay;
|
||||
using SGModule.Net;
|
||||
using System.Linq;
|
||||
using DontConfuse;
|
||||
using SGModule.Common.Extensions;
|
||||
|
||||
public enum VipDay
|
||||
@@ -57,6 +58,7 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
if (_loader != null && !_loader.isDisposed && _loader.texture != null)
|
||||
{
|
||||
_loader.texture = null;
|
||||
@@ -82,6 +84,7 @@ namespace RedHotRoast
|
||||
{
|
||||
ui.group_.y += 68;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
var fileName = GameHelper.GetBackgroundName(4);
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace RedHotRoast
|
||||
FGUI.LG_secretAlbums.LG_secretAlbumsBinder.BindAll();
|
||||
FGUI.LG_Unlock.LG_UnlockBinder.BindAll();
|
||||
FGUI.Egg_20.Egg_20Binder.BindAll();
|
||||
FGUI.ZM_H5_15.ZM_H5_15Binder.BindAll();
|
||||
}
|
||||
|
||||
public static void AutoRegisterCommonPackages()
|
||||
|
||||
@@ -10,7 +10,9 @@ using UnityEngine;
|
||||
namespace RedHotRoast {
|
||||
public class ConfigSystem : BaseSystem {
|
||||
public static string web_through_str;
|
||||
|
||||
public static List<GameUrls> light_weblist = new List<GameUrls>();
|
||||
public static List<GameUrls> dark_weblist = new List<GameUrls>();
|
||||
|
||||
public ConfigSystem(bool isAutoInit = true) {
|
||||
if (isAutoInit) {
|
||||
Init();
|
||||
@@ -104,6 +106,48 @@ namespace RedHotRoast {
|
||||
}
|
||||
|
||||
ConfigLoader.Instance.AddConfig(gameConfigModel);
|
||||
|
||||
|
||||
SetGameUrlConfig();
|
||||
}
|
||||
|
||||
private static List<GameUrls> data_new;
|
||||
public static void SetGameUrlConfig()
|
||||
{
|
||||
|
||||
|
||||
light_weblist.Clear();
|
||||
dark_weblist.Clear();
|
||||
web_through_str = "";
|
||||
data_new = GetConfig<GameUrls>();
|
||||
List<int> type_list = new List<int>();
|
||||
for (int i = 0; i < data_new.Count; i++)
|
||||
{
|
||||
|
||||
if (data_new[i].webType == 2)
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch() && (data_new[i].isMagic == 1)) light_weblist.Add(data_new[i]);
|
||||
else if (!GameHelper.IsGiftSwitch() && (data_new[i].isMagic == 0)) light_weblist.Add(data_new[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
dark_weblist.Add(data_new[i]);
|
||||
if (!type_list.Contains(data_new[i].wvType))
|
||||
{
|
||||
web_through_str += data_new[i].wvthrough;
|
||||
web_through_str += "|";
|
||||
type_list.Add(data_new[i].wvType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
web_through_str.Remove(web_through_str.Length - 1);
|
||||
|
||||
Debug.Log("light_weblist-----" + light_weblist.Count);
|
||||
Debug.Log("dark_weblist-----"+ dark_weblist.Count);
|
||||
Debug.Log("////////////////////////");
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -67,7 +67,6 @@ namespace RedHotRoast
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.GetPlayData);
|
||||
|
||||
MaxADKit.SetUserID(loginData.Uid.As<string>());
|
||||
if (loginData.IsMagic) UnityManager.DakaiACT();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -6,21 +6,7 @@ namespace IgnoreOPS
|
||||
|
||||
public class UnityManager : BaseUnityManager<UnityManager>
|
||||
{
|
||||
|
||||
|
||||
|
||||
public static void DakaiACT()
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.DakaiACT();
|
||||
#endif
|
||||
}
|
||||
public static void ShezhiACT(bool act)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.ShezhiACT(act);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void haveSimCard(string have)
|
||||
{
|
||||
Log.Info("UnityManager", $"haveSimCard: {have}");
|
||||
|
||||
@@ -0,0 +1,740 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using FairyGUI;
|
||||
using Newtonsoft.Json;
|
||||
using RedHotRoast;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DontConfuse
|
||||
{
|
||||
|
||||
|
||||
public class WebviewManager : MonoBehaviour
|
||||
{
|
||||
// Vector2 startPos;
|
||||
// float lastTouchTime = 0f;
|
||||
// float touchInterval = 0.3f;
|
||||
// void Update()
|
||||
// {
|
||||
// #if UNITY_IOS && !UNITY_EDITOR
|
||||
// if(Input.touchCount > 0)
|
||||
// {
|
||||
// Touch touch_ = Input.GetTouch(0);
|
||||
//
|
||||
// if(touch_.phase == TouchPhase.Began)
|
||||
// {
|
||||
// startPos = touch_.position;
|
||||
// lastTouchTime = Time.time;
|
||||
// }
|
||||
// if(touch_.phase == TouchPhase.Ended)
|
||||
// {
|
||||
// if ((Time.time - lastTouchTime) < touchInterval){
|
||||
// // if (WebViewMgr.Instance.WebUIType == WebUIType.H5 && EventSystem.current.currentSelectedGameObject == null){
|
||||
// // BrigdeIOS.SetTouchWebview(true, true);
|
||||
// // }else{
|
||||
// // BrigdeIOS.SetTouchWebview(true);
|
||||
// // }
|
||||
// BrigdeIOS.SetClickView();
|
||||
// }
|
||||
// }
|
||||
// // if(touch_.phase == TouchPhase.Moved){
|
||||
// // Vector2 delta = touch_.position - startPos;
|
||||
// // // Debug.Log("delta Y: " + delta.y);
|
||||
// // BrigdeIOS.ScrollWebview(delta.x, delta.y);
|
||||
// // startPos = touch_.position;
|
||||
// // }
|
||||
// }
|
||||
// #endif
|
||||
// }
|
||||
public static WebviewManager Instance;
|
||||
public WebviewManager()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
public void OpenWebView(string url)
|
||||
{
|
||||
//Debug.Log("[WebviewManager] OpenWebView");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.OpenWebview(url);
|
||||
#endif
|
||||
}
|
||||
public void showDarkWebview()
|
||||
{
|
||||
//Debug.Log("[WebviewManager] OpenWebView");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.showDarkWebview();
|
||||
#endif
|
||||
}
|
||||
|
||||
public void CloseWebview()
|
||||
{
|
||||
//Debug.Log("[WebviewManager] CloseWebview");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.CloseWebview();
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetOffset(int offset_y, int offset_y1)
|
||||
{
|
||||
// Debug.Log($"barry [WebviewManager] SetOffset:{offset_y}, {offset_y1}");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetOffset(offset_y, offset_y1);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetPadding(float left, float top, float right, float bottom)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetPadding");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetPadding(left, top, right, bottom);
|
||||
#endif
|
||||
}
|
||||
public void SetDarkThough(bool though)
|
||||
{
|
||||
if(!GameHelper.IsGiftSwitch()) return;
|
||||
// if (though)
|
||||
// {
|
||||
// if (UI.Instance.IsExistUI(UIConst.LevelSuccessUI) || UI.Instance.IsExistUI(UIConst.MakeupConfirmUI) ||
|
||||
// UI.Instance.IsExistUI(UIConst.NewTaskUI) || UI.Instance.IsExistUI(UIConst.PackrewardUI) || UI.Instance.IsExistUI(UIConst.SaveingPotUI)
|
||||
// )
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// }
|
||||
// Debug.Log("[WebviewManager] SetPadding");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetDarkThough(though);
|
||||
#endif
|
||||
}
|
||||
public void SetBtn(int left, int top, int right, int bottom)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetBtn");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetBtn(left, top, right, bottom);
|
||||
#endif
|
||||
}
|
||||
public void SetCTEnable(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetCTEnable(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetFullScreen()
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetFullScreen");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetFullScreen();
|
||||
#endif
|
||||
}
|
||||
|
||||
public void addH5Field(int field1, int field2, int field3, int field4, int field5, string field6, string field7, string dark_url, string light_url, bool is_gift, string web_through_str, string click_add_time)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.addH5Field(field1,field2,field3,field4,field5,field6,field7,dark_url,light_url,is_gift,web_through_str,click_add_time);
|
||||
#endif
|
||||
}
|
||||
public void ShowH5View(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.ShowH5View(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetIconProgress(float val)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetIconProgress(val);
|
||||
#endif
|
||||
}
|
||||
public void setInH5View(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.setInH5View(flag);
|
||||
#endif
|
||||
}
|
||||
public void upDataH5times(string weblink, int times, bool is_dark)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.upDataH5times( weblink, times,is_dark);
|
||||
#endif
|
||||
}
|
||||
public void ShowFlyBtn(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.ShowFlyBtn(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void setFlyBtnTag(bool flag)
|
||||
{
|
||||
// Debug.Log($"[WebviewManager] setFlyBtnTag ---{flag}");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.setFlyBtnTag(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void setRewardBtnTag(bool flag)
|
||||
{
|
||||
// Debug.Log($"[WebviewManager] setRewardBtnTag--- {flag}");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.setRewardBtnTag(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ObjC_TouchClick(string name)
|
||||
{
|
||||
// Debug.Log("Touch click: " + name);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.H5ViewClickBtn, name);
|
||||
}
|
||||
public void H5AutoRefresh(string times)
|
||||
{
|
||||
if (times == "") return;
|
||||
DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
newDate = newDate.AddSeconds(GameHelper.GetNowTime(true));
|
||||
var newDays = newDate.Day;
|
||||
|
||||
|
||||
|
||||
if (times == "Dailyrefreshtimes")
|
||||
{
|
||||
var last_time = PlayerPrefs.GetInt("Dayreftimes", 0);
|
||||
|
||||
if (last_time == newDays)
|
||||
{
|
||||
var numbers = PlayerPrefs.GetInt("Dailyrefreshnum", 0);
|
||||
numbers++;
|
||||
PlayerPrefs.SetInt("Dailyrefreshnum", numbers);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
PlayerPrefs.SetInt("Dailyrefreshnum", 1);
|
||||
PlayerPrefs.SetInt("Dayreftimes", newDays);
|
||||
string darkWVRefreshtime_str = "";
|
||||
string darkWVDailyrefreshtimes_str = "";
|
||||
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVRefreshtime.Length; i++)
|
||||
{
|
||||
if (i != 0) darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.GetCommonConf().darkWVRefreshtime[i].ToString();
|
||||
}
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVRefreshtime2.Length; i++)
|
||||
{
|
||||
darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.GetCommonConf().darkWVRefreshtime2[i].ToString();
|
||||
}
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes.Length; i++)
|
||||
{
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes[i].ToString();
|
||||
}
|
||||
WebviewManager.Instance.addH5Field(ConfigSystem.GetCommonConf().flyCtRate, ConfigSystem.GetCommonConf().otherH5switch,
|
||||
ConfigSystem.GetCommonConf().H5Refreshtime, ConfigSystem.GetCommonConf().Dailyrefreshtimes, ConfigSystem.GetCommonConf().darkThoughProbability, darkWVRefreshtime_str,
|
||||
darkWVDailyrefreshtimes_str, "", "", GameHelper.IsGiftSwitch(), "", "");
|
||||
}
|
||||
}
|
||||
else if (times.Contains("dark_Dailyrefreshtimes"))
|
||||
{
|
||||
var last_time = PlayerPrefs.GetInt("dark_refreshDay", 0);
|
||||
if (last_time == newDays)
|
||||
{
|
||||
// var numbers = PlayerPrefs.GetInt("dark_Dayref", 0);
|
||||
// numbers++;
|
||||
// PlayerPrefs.SetInt("dark_Dayref", numbers);
|
||||
string[] temp_arr = times.Split("|");
|
||||
if (temp_arr.Length >= 2)
|
||||
{
|
||||
SaveData.GetSaveObject().dark_Dayref[Int32.Parse(temp_arr[1])]++;
|
||||
SaveData.SaveDataFunc();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// PlayerPrefs.SetInt("dark_Dayref", 1);
|
||||
string[] temp_arr = times.Split("|");
|
||||
if (temp_arr.Length >= 2)
|
||||
{
|
||||
SaveData.GetSaveObject().dark_Dayref[Int32.Parse(temp_arr[1])] = 1;
|
||||
SaveData.SaveDataFunc();
|
||||
}
|
||||
PlayerPrefs.SetInt("dark_refreshDay", newDays);
|
||||
string darkWVRefreshtime_str = "";
|
||||
string darkWVDailyrefreshtimes_str = "";
|
||||
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVRefreshtime.Length; i++)
|
||||
{
|
||||
if (i != 0) darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.GetCommonConf().darkWVRefreshtime[i].ToString();
|
||||
}
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVRefreshtime2.Length; i++)
|
||||
{
|
||||
darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.GetCommonConf().darkWVRefreshtime2[i].ToString();
|
||||
}
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes.Length; i++)
|
||||
{
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes[i].ToString();
|
||||
}
|
||||
WebviewManager.Instance.addH5Field(ConfigSystem.GetCommonConf().flyCtRate, ConfigSystem.GetCommonConf().otherH5switch,
|
||||
ConfigSystem.GetCommonConf().H5Refreshtime, ConfigSystem.GetCommonConf().Dailyrefreshtimes, ConfigSystem.GetCommonConf().darkThoughProbability, darkWVRefreshtime_str,
|
||||
darkWVDailyrefreshtimes_str, "", "", GameHelper.IsGiftSwitch(), "", "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
string[] temp_array = times.Split("|");
|
||||
if (temp_array.Length >= 2 && temp_array[0] != null && temp_array[0] != "")
|
||||
{
|
||||
if (temp_array[1] == "h5")
|
||||
{
|
||||
NetApi.H5RefreshTimes<H5refreshTimes>(temp_array[0], "h5", (isSuccess, obj) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
int numbers = 0;
|
||||
for (int i = 0; i < ConfigSystem.light_weblist.Count; i++)
|
||||
{
|
||||
if (ConfigSystem.light_weblist[i].webLink == temp_array[0])
|
||||
{
|
||||
// Debug.Log("uuuuuuuuuuuuuuuuu明穿透" + temp_array[0] + "已经刷新了" + obj.times + "次" + "上限是" + ConfigSystem.light_weblist[i].refreshMax + "次");
|
||||
numbers = ConfigSystem.light_weblist[i].refreshMax - obj.times;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (numbers < 0) numbers = 0;
|
||||
upDataH5times(temp_array[0], numbers, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
H5sendClass info = new H5sendClass() { link = temp_array[0], type = "h6" };
|
||||
NetApi.H5RefreshTimes<H5refreshTimes>(temp_array[0], "h6", (isSuccess, obj) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
int numbers = 0;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (ConfigSystem.dark_weblist[i].webLink == temp_array[0])
|
||||
{
|
||||
// Debug.Log("uuuuuuuuuuuuuuuuu暗穿透" + temp_array[0] + "已经刷新了" + obj.times + "次" + "上限是" + ConfigSystem.dark_weblist[i].refreshMax + "次");
|
||||
numbers = ConfigSystem.dark_weblist[i].refreshMax - obj.times;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (numbers < 0) numbers = 0;
|
||||
upDataH5times(temp_array[0], numbers, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private GList select_glist;
|
||||
private float select_glist_y;
|
||||
public void TouchClickPoint(string name)
|
||||
{
|
||||
// Debug.Log("TouchClickPoint" + name);
|
||||
if (name == null) return;
|
||||
if (name == "flyBtn")
|
||||
{
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.fly_ct_people,1);
|
||||
TrackKit.SendEvent(HallBehaviorTrack.Event, HallBehaviorTrack.Property.fly_ct_number);
|
||||
}
|
||||
|
||||
if (name == "rewardBtn")
|
||||
{
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.annular_ct_people,1);
|
||||
TrackKit.SendEvent(HallBehaviorTrack.Event, HallBehaviorTrack.Property.annular_ct_number);
|
||||
}
|
||||
|
||||
if (name == "finish")
|
||||
{
|
||||
TrackKit.SendEvent(HallBehaviorTrack.Event, HallBehaviorTrack.Property.annular_finish_number);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
string[] a = name.Split("|");
|
||||
if (a.Length < 2) return;
|
||||
if (!float.TryParse(a[0], out float x) || !float.TryParse(a[1], out float y))
|
||||
{
|
||||
Debug.LogError("Invalid format for coordinates: " + name);
|
||||
return;
|
||||
}
|
||||
|
||||
Vector2 fguiScreenPos = new(x * GRoot.inst.width, y * GRoot.inst.height);
|
||||
|
||||
// Debug.Log("mmmmmmmmmmmmmmmmmm" + a[0]);
|
||||
// Debug.Log("mmmmmmmmmmmmmmmmmm" + a[1]);
|
||||
// if (AppConst.DeviceLangue == "pt")
|
||||
// {
|
||||
// fguiScreenPos = new Vector2((float.Parse(a[0]) * GRoot.inst.width) / 1000000.0f,
|
||||
// float.Parse(a[1]) * GRoot.inst.height / 1000000.0f);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
//}
|
||||
GButton objUnderPoint = null;
|
||||
|
||||
var child_array = GRoot.inst.GetChildren().Reverse();
|
||||
bool click_card = true;
|
||||
foreach (GComponent child in child_array) //normal
|
||||
{
|
||||
if (child.GetChildren().Length > 0)
|
||||
{
|
||||
var com_array = child.GetChildren().Reverse();
|
||||
foreach (GComponent com_child in com_array) //com_层面
|
||||
{
|
||||
if (child.name == "Popup" || child.name == "Highest")
|
||||
{
|
||||
click_card = false;/* */
|
||||
}
|
||||
var btn_array = com_child.GetChildren();
|
||||
for (int i = btn_array.Length - 1; i >= 0; i--) //btn_层面
|
||||
{
|
||||
// if (btn_array[i] .name=="btn_collect")
|
||||
// {
|
||||
// Debug.Log(btn_array[i].x);
|
||||
// Debug.Log(btn_array[i].y);
|
||||
// Debug.Log(fguiScreenPos.x);
|
||||
// Debug.Log(fguiScreenPos.y);
|
||||
// Debug.Log(btn_array[i].position.x <= fguiScreenPos.x &&
|
||||
// fguiScreenPos.x <= btn_array[i].position.x + btn_array[i].width);
|
||||
// Debug.Log( btn_array[i].position.y <= fguiScreenPos.y &&
|
||||
// fguiScreenPos.y <= btn_array[i].position.y + btn_array[i].height);
|
||||
// }
|
||||
|
||||
if (btn_array[i] is GButton)
|
||||
{
|
||||
GButton temp = btn_array[i] as GButton;
|
||||
|
||||
if (temp.onStage && temp.visible && temp.position.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= temp.position.x + temp.width &&
|
||||
temp.position.y <= fguiScreenPos.y &&
|
||||
fguiScreenPos.y <= temp.position.y + temp.height)
|
||||
{
|
||||
objUnderPoint = btn_array[i] as GButton;
|
||||
if (objUnderPoint.enabled)
|
||||
{
|
||||
objUnderPoint.FireClick(true, true);
|
||||
}
|
||||
else objUnderPoint.FireClick(true, false);
|
||||
goto EndLoop;
|
||||
}
|
||||
}
|
||||
|
||||
else if (btn_array[i] is GTextInput)
|
||||
{
|
||||
|
||||
GTextInput temp = btn_array[i] as GTextInput;
|
||||
if (temp.onStage && temp.visible && temp.position.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= temp.position.x + temp.width &&
|
||||
temp.position.y <= fguiScreenPos.y &&
|
||||
fguiScreenPos.y <= temp.position.y + temp.height)
|
||||
{
|
||||
|
||||
temp.RequestFocus();
|
||||
goto EndLoop;
|
||||
}
|
||||
|
||||
}
|
||||
else if (btn_array[i] is GList)
|
||||
{
|
||||
|
||||
GList temp = btn_array[i] as GList;
|
||||
if (temp.onStage && temp.visible && temp.position.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= temp.position.x + temp.width &&
|
||||
temp.position.y <= fguiScreenPos.y &&
|
||||
fguiScreenPos.y <= temp.position.y + temp.height)
|
||||
{
|
||||
if (select_glist == null)
|
||||
{
|
||||
select_glist_y = fguiScreenPos.y;
|
||||
select_glist = btn_array[i] as GList;
|
||||
}
|
||||
else
|
||||
{
|
||||
select_glist.scrollPane.posY -= (fguiScreenPos.y - select_glist_y);
|
||||
select_glist_y = fguiScreenPos.y;
|
||||
}
|
||||
|
||||
goto EndLoop;
|
||||
}
|
||||
|
||||
}
|
||||
else if (btn_array[i] is GComponent)
|
||||
{
|
||||
var child_btn_array = btn_array[i].asCom.GetChildren(); //嵌套的com
|
||||
|
||||
for (int j = child_btn_array.Length - 1; j >= 0; j--)
|
||||
{
|
||||
if (child_btn_array[j] is GButton)
|
||||
{
|
||||
Vector2 local_pos = new Vector2(btn_array[i].x + child_btn_array[j].x,
|
||||
btn_array[i].y + child_btn_array[j].y);
|
||||
if (child_btn_array[j].visible && child_btn_array[j].onStage && child_btn_array[j].visible && local_pos.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= local_pos.x + child_btn_array[j].width &&
|
||||
local_pos.y <= fguiScreenPos.y && fguiScreenPos.y <=
|
||||
local_pos.y + child_btn_array[j].height)
|
||||
{
|
||||
objUnderPoint = child_btn_array[j] as GButton;
|
||||
if (objUnderPoint.enabled) objUnderPoint.FireClick(true, true);
|
||||
else objUnderPoint.FireClick(true, false);
|
||||
goto EndLoop;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (child.name == "Popup" || child.name == "Highest")
|
||||
{
|
||||
goto EndLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EndLoop: Debug.Log("");
|
||||
// if (click_card)
|
||||
// {
|
||||
// if (orthoCamera == null) orthoCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
// Ray ray = orthoCamera.ScreenPointToRay(new Vector2(float.Parse(a[0]) * Screen.width, (1 - float.Parse(a[1])) * Screen.height));
|
||||
// RaycastHit hit;
|
||||
// int layerMask = 1 << 6;
|
||||
|
||||
// if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
|
||||
// {
|
||||
// // GameDispatcher.Instance.Dispatch(GameMsg.card_click, hit.collider.gameObject.name);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
public Camera orthoCamera;
|
||||
|
||||
public static Dictionary<string, string> adCallbackInfo = new Dictionary<string, string>();
|
||||
public void SendH5Event(string numbers)
|
||||
{
|
||||
|
||||
// adCallbackInfo.Clear();
|
||||
// adCallbackInfo.Add("h5_revenue",ConfigSystem.GetCommonConf().h5_refreshRevenue.ToString());
|
||||
// //Debug.Log("sssssssssssssssssss"+JsonConvert.SerializeObject(adCallbackInfo));
|
||||
// AppsFlyer.sendEvent("Growing_Total_01_002",adCallbackInfo);
|
||||
}
|
||||
|
||||
public void RefreshUrl()
|
||||
{
|
||||
|
||||
// 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());
|
||||
var newDays = newDate.Day;
|
||||
|
||||
|
||||
|
||||
if (last_time == newDays)
|
||||
{
|
||||
Dailyrefresh_reamain = ConfigSystem.GetCommonConf().Dailyrefreshtimes -
|
||||
PlayerPrefs.GetInt("Dailyrefreshnum", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerPrefs.SetInt("Dailyrefreshnum", 0);
|
||||
Dailyrefresh_reamain = ConfigSystem.GetCommonConf().Dailyrefreshtimes;
|
||||
PlayerPrefs.SetInt("Dayreftimes", newDays);
|
||||
}
|
||||
|
||||
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());
|
||||
var dark_newDays = dark_newDate.Day;
|
||||
|
||||
|
||||
string darkWVDailyrefreshtimes_str = "";
|
||||
|
||||
|
||||
if (SaveData.GetSaveObject().dark_Dayref == null)
|
||||
{
|
||||
SaveData.GetSaveObject().dark_Dayref = new int[2];
|
||||
}
|
||||
|
||||
if (dark_last_time == dark_newDays)
|
||||
{
|
||||
// dark_Dailyrefresh_reamain = ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes[Int32.Parse(webview_index) - 1] -
|
||||
// PlayerPrefs.GetInt("dark_Dayref", 0);
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes.Length; i++)
|
||||
{
|
||||
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.GetCommonConf().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.GetCommonConf().darkWVDailyrefreshtimes[Int32.Parse(webview_index)];
|
||||
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes.Length; i++)
|
||||
{
|
||||
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.GetCommonConf().darkWVDailyrefreshtimes[i];
|
||||
|
||||
}
|
||||
|
||||
PlayerPrefs.SetInt("dark_refreshDay", dark_newDays);
|
||||
}
|
||||
|
||||
// var last_login_time = PlayerPrefs.GetInt("last_login_time", 0);//获取上次登录日期
|
||||
// PlayerPrefs.SetInt("last_login_time", newDays);
|
||||
|
||||
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);
|
||||
// }
|
||||
|
||||
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);
|
||||
// }
|
||||
|
||||
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 + "#" + ConfigSystem.dark_weblist[i].darkWebTimesCT2;
|
||||
}
|
||||
|
||||
|
||||
string darkWVRefreshtime_str = "";
|
||||
|
||||
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVRefreshtime.Length; i++)
|
||||
{
|
||||
if (i != 0) darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.GetCommonConf().darkWVRefreshtime[i].ToString();
|
||||
}
|
||||
for (int i = 0; i < ConfigSystem.GetCommonConf().darkWVRefreshtime2.Length; i++)
|
||||
{
|
||||
darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.GetCommonConf().darkWVRefreshtime2[i].ToString();
|
||||
}
|
||||
|
||||
Debug.Log("--------------------------------");
|
||||
|
||||
string add_time = ConfigSystem.GetCommonConf().WVClickAddTime[0] + "|" + ConfigSystem.GetCommonConf().WVClickAddTime[1];
|
||||
|
||||
Debug.Log(add_time);
|
||||
WebviewManager.Instance.addH5Field(ConfigSystem.GetCommonConf().flyCtRate, ConfigSystem.GetCommonConf().otherH5switch,
|
||||
ConfigSystem.GetCommonConf().H5Refreshtime, Dailyrefresh_reamain, ConfigSystem.GetCommonConf().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.GetCommonConf().flyCtRate);
|
||||
// RefreshDataCT(isTop, gameUrlInfo);
|
||||
}
|
||||
|
||||
public void ClickAdEvent(string ad_msg)
|
||||
{
|
||||
string[] temp_array = ad_msg.Split("|");
|
||||
if (temp_array.Length >= 2 && temp_array[0] != null && temp_array[0] != "")
|
||||
{
|
||||
NetApi.SetClickAdEvent<object>(temp_array[0], temp_array[1], (isSuccess, obj) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
Debug.Log(" click event" + temp_array[0]);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public static bool haveSimCard = false;
|
||||
public void diaoyongtest(string have)
|
||||
{
|
||||
if (have == "TRUE") haveSimCard = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class H5refreshTimes
|
||||
{
|
||||
[JsonProperty("link")]
|
||||
public string link;
|
||||
[JsonProperty("times")]
|
||||
public int times;
|
||||
|
||||
}
|
||||
public class H5sendClass
|
||||
{
|
||||
[JsonProperty("link")]
|
||||
public string link;
|
||||
[JsonProperty("type")]
|
||||
public string type;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10f6b7f1583d4091abbe0353dd8ca672
|
||||
timeCreated: 1779342726
|
||||
Reference in New Issue
Block a user