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
+67
View File
@@ -0,0 +1,67 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.InteropServices;
using UnityEditor;
public class BrigdeIOS
{
[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);
[DllImport("__Internal")]
public static extern void copyText(string text);
[DllImport("__Internal")]
public static extern void showGameA(bool flag);
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5cb70e5466b624eb4ba3a4732703e7f2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -2,136 +2,24 @@ using System.Collections;
using UnityEngine;
using AppsFlyerSDK;
using System.Collections.Generic;
using Unity.Advertisement.IosSupport;
using BingoBrain;
using BingoBrain.Core;
using System;
using DG.Tweening;
using BingoBrain.HotFix;
public class AppsFlyerObjectScript1 : MonoBehaviour, IAppsFlyerConversionData
public class AppsFlyerObjectScript1 : MonoBehaviour
{
public string appID = null;
public bool is_init = false;
public Coroutine m_Coroutine;
void Start()
{
AddListener();
AppsFlyer.setIsDebug(true);
#if UNITY_IOS && !UNITY_EDITOR
appID = "6557062195";
m_Coroutine = IsfvKit.StartCoroutine(loopWaitInitAf());
#endif
#if UNITY_EDITOR
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
#endif
}
private void AddListener()
{
NetworkDispatcher.Instance.AddListener(NetworkMsg.NotNetwork, RequestLogin);
}
private void RemoveListener()
{
NetworkDispatcher.Instance.RemoveListener(NetworkMsg.NotNetwork, RequestLogin);
}
void RequestLogin(object obj = null)
{
if (GameHelper.IsConnect())
{
GameDispatcher.Instance.Dispatch(BingoInfo.Network_reconnection);
}
IsfvKit.StopCoroutine(m_Coroutine);
m_Coroutine = IsfvKit.StartCoroutine(loopWaitInitAf());
}
void OnDestroy() {
RemoveListener();
}
IEnumerator loopWaitInitAf()
{
if (!GameHelper.IsConnect())
{
Action action = () =>
{
DOVirtual.DelayedCall(0.5f, ()=>{
NetworkDispatcher.Instance.Dispatch(NetworkMsg.NotNetwork);
});
};
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open,action);
yield return null;
}
GameHelper.PostFunnelLogin("afSend");
float a = 0;
if (ATTrackingStatusBinding.GetAuthorizationTrackingStatus() ==
ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
{
ATTrackingStatusBinding.RequestAuthorizationTracking();
}
while ((ATTrackingStatusBinding.GetAuthorizationTrackingStatus() ==
ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED) && (a < 5.0f))
{
a += 0.5f;
yield return new WaitForSeconds(0.5f);
}
AppsFlyer.initSDK("ds3rwfCqqVQYHAwt6ZJQSg", appID, this);
AppsFlyer.startSDK();
AppsFlyer.AFLog("8888888888888888888", ATTrackingStatusBinding.GetAuthorizationTrackingStatus().ToString());
//yield return new WaitForSeconds(0.5f);
}
public void onConversionDataSuccess(string conversionData)
{
if (is_init) return;
is_init = true;
AppsFlyer.AFLog("onConversionDataSuccess", conversionData);
var conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
var json = SerializeUtil.ToJsonIndented(conversionDataDictionary);
BingoBea.Instance.attribution =
conversionDataDictionary.TryGetValue("af_status", out var afStatus)
? afStatus.ToString().ToLower()
: "organic";
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
GameHelper.PostFunnelLogin("afRecv", true);
}
public void onConversionDataFail(string error)
{
if (is_init) return;
is_init = true;
AppsFlyer.AFLog("onConversionDataFail", error);
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
GameHelper.PostFunnelLogin("afRecv", false);
}
public void onAppOpenAttribution(string attributionData)
{
AppsFlyer.AFLog("onAppOpenAttribution", attributionData);
Dictionary<string, object> attributionDataDictionary =
AppsFlyer.CallbackStringToDictionary(attributionData);
}
public void onAppOpenAttributionFailure(string error)
{
AppsFlyer.AFLog("onAppOpenAttributionFailure", error);
}
}
@@ -59,4 +59,5 @@ public static class CsjInfoC
public static readonly uint WorldRaycast_EnableChange = ++Cursor_BASE;
public static readonly uint LoginInit = ++Cursor_BASE;
public static readonly uint Show_uid = ++Cursor_BASE;
}
@@ -42,6 +42,7 @@ public string attribution = "organic";
{
// LastFocusFlaseTime = DateTimeBoardk.Instance.GetServerCurrTimestamp();
AppDispatcher.Instance.Dispatch(CsjInfoC.App_Focus_False, focus);
SaveData.saveDataFunc();
}
}
public override void Init()
+10 -1
View File
@@ -1,4 +1,5 @@
using BingoBrain.HotFix;
using UnityEngine;
namespace BingoBrain.Core
{
@@ -48,7 +49,15 @@ namespace BingoBrain.Core
public static void Enter()
{
AppDispatcher.Instance.Dispatch(CsjInfoC.UI_DisplayLoadingUI);
if (PlayerPrefs.GetInt("is_gift") == 1)
{
AppDispatcher.Instance.Dispatch(CsjInfoC.UI_DisplayLoadingUI);
}
else
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.LoginAUI_Open);
}
}
public static void HideLoadingUI(bool isDelay = false)
+2 -1
View File
@@ -1,6 +1,7 @@
using BingoBrain;
using BingoBrain.Core;
using Newtonsoft.Json;
public class LoginModel
@@ -20,7 +21,7 @@ public class LoginModel
public string cdn_url;
public long login_time;
public long reg_time;
public Preferences preferences;
public Preferences preferences;
public bool debug_log = true;
public int enwp;
public LoginModel()
+103 -75
View File
@@ -8,6 +8,7 @@ using DG.Tweening;
using BingoBrain.HotFix;
using DontConfuse;
using System;
using Spine;
public class LoginSystem : BaseSystem
@@ -38,108 +39,135 @@ public class LoginSystem : BaseSystem
private void AddListener()
{
// NetworkDispatcher.Instance.AddListener(NetworkMsg.Login, OnRequestLogin);
// NetworkDispatcher.Instance.AddListener(NetworkMsg.Reconnect, OnResponseReconnect);
NetworkDispatcher.Instance.AddListener(NetworkMsg.Login, OnRequestLogin);
// NetworkDispatcher.Instance.AddListener(NetworkMsg.Reconnect, OnResponseReconnect);
}
private void RemoveListener()
{
// NetworkDispatcher.Instance.RemoveListener(NetworkMsg.Login, OnRequestLogin);
NetworkDispatcher.Instance.RemoveListener(NetworkMsg.Login, OnRequestLogin);
// NetworkDispatcher.Instance.RemoveListener(NetworkMsg.Reconnect, OnResponseReconnect);
// NetworkDispatcher.Instance.RemoveListener(NetworkMsg.Reconnect, OnResponseReconnect);
}
private void RequestLogin()
{
var requestLoginData = new RequestLoginData
{
device_id = SystemInfo.deviceUniqueIdentifier,
// device_id ="E742FE8B-C32E-56A7-8F8A-6B3BC0F3169",
// device_id ="E742FE8B-C32E-56A7-8F8A-6B3BC0F3169",
pack_name = NetworkMsg.Identifier,
app_version = Application.version,
channel = BingoBea.Instance.attribution,
sim = WebviewManager.haveSimCard
};
Debug.Log(JsonConvert.SerializeObject(requestLoginData));
Debug.Log(SystemInfo.deviceUniqueIdentifier);
GameHelper.PostFunnelLogin("loginSend");
Debug.Log(JsonConvert.SerializeObject(requestLoginData));
//zhushi // NetworkKit.Post<LoginModel>("login", requestLoginData, (isSuccess, loginData) =>
// {
NetworkKit.Post<LoginModel>("login", requestLoginData, (isSuccess, loginData) =>
{
// if (isSuccess)
// {
// var loginModel = GameHelper.GetLoginModel();
// loginModel.cdn_url = loginData.cdn_url;
// loginModel.setting = loginData.setting;
// loginModel.play_data = loginData.play_data;
// loginModel.token = loginData.token;
// loginModel.uid = loginData.uid;
// loginModel.country = loginData.country;
// loginModel.expires_at = loginData.expires_at;
// loginModel.is_magic = loginData.is_magic;
// loginModel.invite_code = loginData.invite_code;
// loginModel.invite_url = loginData.invite_url;
// loginModel.last_login_time = loginData.last_login_time;
// loginModel.login_time = loginData.login_time;
// loginModel.reg_time = loginData.reg_time;
// loginModel.new_player = loginData.new_player;
// loginModel.debug_log = loginData.debug_log;
// loginModel.enwp = loginData.enwp;
if (isSuccess)
{
Debug.Log("Login" + "-------------------" + JsonConvert.SerializeObject(loginData));
var loginModel = GameHelper.GetLoginModel();
loginModel.cdn_url = loginData.cdn_url;
loginModel.setting = loginData.setting;
loginModel.play_data = loginData.play_data;
loginModel.token = loginData.token;
loginModel.uid = loginData.uid;
loginModel.country = loginData.country;
loginModel.expires_at = loginData.expires_at;
loginModel.is_magic = loginData.is_magic;
loginModel.invite_code = loginData.invite_code;
loginModel.invite_url = loginData.invite_url;
loginModel.last_login_time = loginData.last_login_time;
loginModel.login_time = loginData.login_time;
loginModel.reg_time = loginData.reg_time;
loginModel.new_player = loginData.new_player;
loginModel.debug_log = loginData.debug_log;
loginModel.enwp = loginData.enwp;
if (loginData.is_magic)
{
if (PlayerPrefs.GetInt("is_gift") != 1)
{
AppDispatcher.Instance.Dispatch(CsjInfoC.UI_DisplayLoadingUI);
UICtrlDispatcher.Instance.Dispatch(SkinInfo.LoginAUI_Close);
}
PlayerPrefs.SetInt("is_gift", 1);
}
else
{
#if BingoBrainRelease
BrigdeIOS.showGameA(true);
#else
AppDispatcher.Instance.Dispatch(CsjInfoC.Show_uid);
DOVirtual.DelayedCall(2, () =>
{
BrigdeIOS.showGameA(true);
});
#endif
return;
}
loginModel.preferences = new Preferences();
NetworkKit.CDNUrl = $"{loginData.cdn_url}/";
NetworkKit.SetCacheToken(loginData.token);
//RequestHeart();
DateTimeBoardk.Instance.SetServerCurrTimestamp(loginData.login_time);
Sequence mLoopSequence = DOTween.Sequence();
mLoopSequence.AppendCallback(() =>
{
RequestHeart();
// loginModel.preferences = new Preferences();
// NetworkKit.CDNUrl = $"{loginData.cdn_url}/";
// NetworkKit.SetCacheToken(loginData.token);
// //RequestHeart();
// DateTimeBoardk.Instance.SetServerCurrTimestamp(loginData.login_time);
// Sequence mLoopSequence = DOTween.Sequence();
// mLoopSequence.AppendCallback(() =>
// {
// RequestHeart();
}).AppendInterval(60).SetLoops(-1);
//TimerHelper.UnscaleGeneral.AddLoopTimer(60, (timer) => { RequestHeart(); });
NetworkDispatcher.Instance.Dispatch(NetworkMsg.GetPlayData);
//UICtrlDispatcher.Instance.Dispatch(SkinInfo.EnterBingoUI_Open);
// }).AppendInterval(60).SetLoops(-1);
// //TimerHelper.UnscaleGeneral.AddLoopTimer(60, (timer) => { RequestHeart(); });
// //NetworkDispatcher.Instance.Dispatch(NetworkMsg.GetPlayData);
// //UICtrlDispatcher.Instance.Dispatch(SkinInfo.EnterBingoUI_Open);
// PreferencesMgr.Instance.PlayerName = loginData.invite_code;
// NetworkDispatcher.Instance.Dispatch(ExternalInfo.GetConfig);
// MaxADKit.Init();
// GameHelper.PostFunnelLogin("loginRecv", true);
// if (GameHelper.IsGiftSwitch())
// {
// GameObject.Find("MainCameraRoot").SetActive(false);
// }
// else{
// GameObject.Find("sheep_parent").SetActive(false);
// }
// }
// else
// {
// //UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.NetLoadingUI_Close);
// Debug.Log("登陆请求失败");
// GameHelper.PostFunnelLogin("loginRecv", false);
PreferencesMgr.Instance.PlayerName = loginData.invite_code;
NetworkDispatcher.Instance.Dispatch(ExternalInfo.GetConfig);
GameHelper.PostFunnelLogin("loginRecv", true);
// if (GameHelper.IsGiftSwitch())
// {
// // GameObject.Find("MainCameraRoot").SetActive(false);
// }
// float times = loginCount == 0 ? 0 : 5f;
}
else
{
Debug.Log(JsonConvert.SerializeObject(loginData));
//UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.NetLoadingUI_Close);
Debug.Log("登陆请求失败");
GameHelper.PostFunnelLogin("loginRecv", false);
// DOVirtual.DelayedCall(times,()=>{
// if (loginCount < LoginCountLimit) {
// loginCount++;
// RequestLogin();
// } else {
// loginCount = 0;
// Action _OnFail = () =>
// {
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
// };
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open, _OnFail);
// }
// });
// }
// });
float times = loginCount == 0 ? 0 : 5f;
DOVirtual.DelayedCall(times, () =>
{
if (loginCount < LoginCountLimit)
{
loginCount++;
RequestLogin();
}
else
{
loginCount = 0;
Action _OnFail = () =>
{
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
};
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open, _OnFail);
}
});
}
});
}
@@ -186,7 +214,7 @@ public partial class NetworkMsg
public static uint UpdateCheckInviteData = ++MsgRootLogic;
public static string Identifier = "com.interactivegames123.bingograssland";
public static string Identifier = "com.interactivegames.bingotornado";
public static uint Start = ++MsgRootLogic;
public static uint NotNetwork = ++MsgRootLogic;
}
+1 -1
View File
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8c3f8903825dc41c9990270946039428
guid: fc860e022cb34724fab1d6c4d3076180
MonoImporter:
externalObjects: {}
serializedVersion: 2
+95 -94
View File
@@ -78,8 +78,8 @@ public class NetworkKit
}
#endif
//Debug.Log(url + "--------" + loginRequest.downloadHandler.text);
//Debug.Log(url + "--------" + receiveContent);
// Debug.Log(url + "--------" + loginRequest.downloadHandler.text);
// Debug.Log(url + "--------" + receiveContent);
var response = SerializeUtil.ToObject<ResponseData>(receiveContent);
if (response?.code == 0)
@@ -234,9 +234,9 @@ public class NetworkKit
public static void BuriedPoint(string eventname, string eventproperty, int integer)
{
if(eventname == BuriedPointEvent.Apple_AD_event || eventname == BuriedPointEvent.Apple_pay_event)
{
eventname = GameHelper.IsAdModelOfPay()?BuriedPointEvent.Apple_AD_event:BuriedPointEvent.Apple_pay_event;
if (eventname == BuriedPointEvent.Apple_AD_event || eventname == BuriedPointEvent.Apple_pay_event)
{
eventname = GameHelper.IsAdModelOfPay() ? BuriedPointEvent.Apple_AD_event : BuriedPointEvent.Apple_pay_event;
}
buriedPointObject.@event = eventname;
@@ -251,7 +251,7 @@ public class NetworkKit
}
public static BuriedPointObject buriedPointObject = new BuriedPointObject();
public static string GetNetworkType()
public static string GetNetworkType()
{
switch (Application.internetReachability)
{
@@ -261,7 +261,7 @@ public class NetworkKit
return NetworkType.wifi;
case NetworkReachability.NotReachable:
return NetworkType.notConnected;
default:
default:
return NetworkType.notConnected;
}
}
@@ -280,25 +280,25 @@ public class NetworkKit
var headers = new Dictionary<string, string> { { "x-token", GetCacheToken() } };
IsfvKit.StartCoroutine(PostInternal<ResquestTokenData>("tokenRefresh", null, (isSuccess, tokenData) =>
IsfvKit.StartCoroutine(PostInternal<ResquestTokenData>("tokenRefresh", null, (isSuccess, tokenData) =>
{
if (isSuccess)
{
LoginModel loginModel = GameHelper.GetLoginModel();
loginModel.token = tokenData.token;
loginModel.expires_at = tokenData.expires_at;
SetCacheToken(tokenData.token);
}
isReqToken = false;
}, headers));
}
private static bool isReqToken1 = false;
public static void ReLoginGetToken()
public static void ReLoginGetToken()
{
if (isReqToken1) return;
@@ -314,13 +314,14 @@ public class NetworkKit
isReqToken1 = true;
Post<LoginModel>("login", requestLoginData, (isSuccess, loginData) =>{
Post<LoginModel>("login", requestLoginData, (isSuccess, loginData) =>
{
if (isSuccess)
{
LoginModel loginModel = GameHelper.GetLoginModel();
loginModel.token = loginData.token;
loginModel.expires_at = loginData.expires_at;
SetCacheToken(loginData.token);
}
@@ -473,101 +474,101 @@ public class BuriedPointObject
}
public class BuriedPointEvent
{
public static string play_event = "Number_of_people_play";
public static string play_property = "Number_of_people_playing";
public static string play_event = "Number_of_people_play";
public static string play_property = "Number_of_people_playing";
public static string playing_event = "Playing_time";
public static string playing_property = "Room_type";
public static string playing_event = "Playing_time";
public static string playing_property = "Room_type";
public static string ad_task = "ad_task";
public static string watch_ad_number = "watch_ad_number";
public static string finish_ad_number = "finish_ad_number";
public static string ad_task = "ad_task";
public static string watch_ad_number = "watch_ad_number";
public static string finish_ad_number = "finish_ad_number";
public static string h5_event = "H5_task";
public static string h5_event_time = "H5_time";
public static string h5_event_numbers = "finish_H5_number";
public static string h5_event = "H5_task";
public static string h5_event_time = "H5_time";
public static string h5_event_numbers = "finish_H5_number";
public static string withdraw_behavior = "withdraw_behavior";
public static string withdraw_message = "withdraw_message";
public static string withdraw_cash1 = "withdraw_cash1";
public static string withdraw_cash2 = "withdraw_cash2";
public static string withdraw_cash3 = "withdraw_cash3";
public static string withdraw_behavior = "withdraw_behavior";
public static string withdraw_message = "withdraw_message";
public static string withdraw_cash1 = "withdraw_cash1";
public static string withdraw_cash2 = "withdraw_cash2";
public static string withdraw_cash3 = "withdraw_cash3";
public static string Hall_behavior = "Hall_behavior";
public static string open_hall_number = "open_hall_number";
//public static string open_hall_people = "open_hall_people";
public static string collect_fly_number = "collect_fly_number";
//public static string collect_fly_people = "collect_fly_people";
public static string fly_ct_number = "fly_ct_number";
//public static string fly_ct_people = "fly_ct_people";
public static string annular_finish_number = "annular_finish_number";
public static string annular_get_number = "annular_get_number";
public static string annular_ct_number = "annular_ct_number";
//public static string annular_ct_people = "annular_ct_people";
public static string Hall_behavior = "Hall_behavior";
public static string open_hall_number = "open_hall_number";
//public static string open_hall_people = "open_hall_people";
public static string collect_fly_number = "collect_fly_number";
//public static string collect_fly_people = "collect_fly_people";
public static string fly_ct_number = "fly_ct_number";
//public static string fly_ct_people = "fly_ct_people";
public static string annular_finish_number = "annular_finish_number";
public static string annular_get_number = "annular_get_number";
public static string annular_ct_number = "annular_ct_number";
//public static string annular_ct_people = "annular_ct_people";
public static string video_behavior = "video_behavior";
public static string watch_ad_people = "watch_ad_people";
public static string watch_success_ad_people = "watch_success_ad_people";
public static string video_behavior = "video_behavior";
public static string watch_ad_people = "watch_ad_people";
public static string watch_success_ad_people = "watch_success_ad_people";
public static string video_type = "video_type";
public static string Rewarded_videos_trigger_number = "Rewarded_videos_trigger_number";
public static string Rewarded_videos_fill_number = "Rewarded_videos_fill_number";
public static string Rewarded_videos_dinish_number = "Rewarded_videos_dinish_number";
public static string Interstitial_videos_trigger_number = "Interstitial_videos_trigger_number";
public static string Interstitial_videos_fill_number = "Interstitial_videos_fill_number";
public static string Interstitial_videos_dinish_number = "Interstitial_videos_dinish_number";
public static string Apple_pay_event = "Pay_Event";
public static string Apple_AD_event = "AD_Event";
public static string video_type = "video_type";
public static string Rewarded_videos_trigger_number = "Rewarded_videos_trigger_number";
public static string Rewarded_videos_fill_number = "Rewarded_videos_fill_number";
public static string Rewarded_videos_dinish_number = "Rewarded_videos_dinish_number";
public static string Interstitial_videos_trigger_number = "Interstitial_videos_trigger_number";
public static string Interstitial_videos_fill_number = "Interstitial_videos_fill_number";
public static string Interstitial_videos_dinish_number = "Interstitial_videos_dinish_number";
public static string Apple_pay_event = "Pay_Event";
public static string Apple_AD_event = "AD_Event";
public static string pack_show = "pack_show";
public static string pack_click = "pack_click";
public static string pack_open = "pack_open";
public static string pack_success = "pack_success";
public static string pack_show = "pack_show";
public static string pack_click = "pack_click";
public static string pack_open = "pack_open";
public static string pack_success = "pack_success";
public static string remove_ad_show = "remove_ad_show";
public static string remove_ad_click = "remove_ad_click";
public static string remove_ad_open = "remove_ad_open";
public static string remove_ad_success = "remove_ad_success";
public static string remove_ad_show = "remove_ad_show";
public static string remove_ad_click = "remove_ad_click";
public static string remove_ad_open = "remove_ad_open";
public static string remove_ad_success = "remove_ad_success";
public static string pass_show = "master_pass_show";
public static string pass_click = "master_pass_click";
public static string pass_open = "pass_open";
public static string pass_success = "master_pass_receive";
public static string pass_show = "master_pass_show";
public static string pass_click = "master_pass_click";
public static string pass_open = "pass_open";
public static string pass_success = "master_pass_receive";
public static string buy_one_show = "buy_one_show";
public static string buy_one_click = "buy_one_click";
public static string buy_one_open = "buy_one_open";
public static string buy_one_success = "buy_one_success";
public static string buy_one_show = "buy_one_show";
public static string buy_one_click = "buy_one_click";
public static string buy_one_open = "buy_one_open";
public static string buy_one_success = "buy_one_success";
public static string gold_show = "shop_show";
public static string gold_click_1 = "shop_click";
public static string gold_show = "shop_show";
public static string gold_click_1 = "shop_click";
public static string gold_click_ad = "gold_click_ad";
public static string gold_click_ad = "gold_click_ad";
// public static string gold_click_2 = "gold_click_2";
// public static string gold_click_3 = "gold_click_3";
// public static string gold_click_4 = "gold_click_4";
// public static string gold_open_1 = "gold_open_1";
// public static string gold_open_2 = "gold_open_2";
// public static string gold_open_3 = "gold_open_3";
// public static string gold_open_4 = "gold_open_4";
public static string gold_success_1 = "shop_receive";
// public static string gold_success_2 = "gold_success_2";
// public static string gold_success_3 = "gold_success_3";
// public static string gold_success_4 = "gold_success_4";
public static string afterRewardAdShow = "afterRewardAdShow";
public static string afterRewardAdEnd = "afterRewardAdEnd";
public static string fail_show = "fail_show";
public static string fail_click = "fail_click";
public static string fail_buy_success = "fail_buy_success";
public static string three_days_gift_show = "three_days_gift_show";
public static string three_days_gift_click = "three_days_gift_click";
public static string three_days_gift_buy_success = "three_days_gift_buy_success";
public static string three_days_gift_open = "three_days_gift_open";
public static string three_day1_success = "three_day1_success";
public static string three_day2_success = "three_day2_success";
public static string three_day3_success = "three_day3_success";
public static string Three_days_gift_event = "Three_days_gift_event";
// public static string gold_click_2 = "gold_click_2";
// public static string gold_click_3 = "gold_click_3";
// public static string gold_click_4 = "gold_click_4";
// public static string gold_open_1 = "gold_open_1";
// public static string gold_open_2 = "gold_open_2";
// public static string gold_open_3 = "gold_open_3";
// public static string gold_open_4 = "gold_open_4";
public static string gold_success_1 = "shop_receive";
// public static string gold_success_2 = "gold_success_2";
// public static string gold_success_3 = "gold_success_3";
// public static string gold_success_4 = "gold_success_4";
public static string afterRewardAdShow = "afterRewardAdShow";
public static string afterRewardAdEnd = "afterRewardAdEnd";
public static string fail_show = "fail_show";
public static string fail_click = "fail_click";
public static string fail_buy_success = "fail_buy_success";
public static string three_days_gift_show = "three_days_gift_show";
public static string three_days_gift_click = "three_days_gift_click";
public static string three_days_gift_buy_success = "three_days_gift_buy_success";
public static string three_days_gift_open = "three_days_gift_open";
public static string three_day1_success = "three_day1_success";
public static string three_day2_success = "three_day2_success";
public static string three_day3_success = "three_day3_success";
public static string Three_days_gift_event = "Three_days_gift_event";
}
+10 -4
View File
@@ -3,14 +3,20 @@ using UnityEngine;
public class OpenBrowser
{
// [DllImport("__Internal")]
// public static extern void _openURL(string url);
[DllImport("__Internal")]
public static extern void _openURL(string url);
public static void OpenURL(string url)
{
// 调用iOS原生方法打开URL
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
_openURL(url);
}
else
{
// 在非iOS平台上,你可以使用Unity的Application.OpenURL方法
Application.OpenURL(url);
}
}
}
@@ -36,6 +36,7 @@ public class PlayDataSystem : BaseSystem
private void OnRequestPlayData(object args)
{
PreferencesMgr.Instance.InitPreferences();
NetworkKit.PostWithHeader<Preferences>("user/userData", (isSuccess, obj) =>
{
var loginModel = GameHelper.GetLoginModel();
+52 -292
View File
@@ -4,324 +4,84 @@ using UnityEngine.Events;
using BingoBrain.Core;
using System.Collections.Generic;
using AppsFlyerSDK;
using DG.Tweening;
namespace BingoBrain.Core
{
public class MaxADKit
{
public static string SDKKey =
"LHx_tPFslZpTTiIPABmS24T7Ev1QEVOUVOzirpkxLUuTwJTVZGCKAk9L3Tm3FwuM5LxHK3q1EIbAemJB5sNpX2";
public static string interstitialADUnitID = "af1076054c8eb56f";
public static string rewardedADUnitID = "d79c2aa7b6ad055d";
private const float RevenueThreshold = 0.1f;
public static Dictionary<string, string> adCallbackInfo;
public static void Init()
{
MaxSdkCallbacks.OnSdkInitializedEvent += sdkConfiguration =>
#if !UNITY_EDITOR
// 注册 ab事件,0或1,0为自然量版本,1为激励版本
MYp0ZVTT2QSDKHelper.Instance.RegistIosParam((i =>
{
InitializeRewardedAds();
InitializeInterstitialAds();
};
BingoBea.Instance.attribution = i == 0 ? "organic" : "non_organic";
Debug.Log($"ios ab param : {i} attribution=== {BingoBea.Instance.attribution}");
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
}));
MaxSdk.SetSdkKey(SDKKey);
var loginModel = GameHelper.GetLoginModel();
user_id = loginModel.uid.ToString();
MaxSdk.SetUserId(loginModel.uid.ToString());
// MaxSdk.SetIsAgeRestrictedUser(false);
MaxSdk.SetHasUserConsent(true);
MaxSdk.SetDoNotSell(false);
MaxSdk.InitializeSdk();
// MaxSdk.ShowMediationDebugger();
adCallbackInfo = new Dictionary<string, string>();
}
#region 广
public static UnityAction<bool> onInterstitialAdCompleted = null;
public static void ShowInterstitial(string placement = "DefaultInterstitial",
UnityAction<bool> onCompleted = null)
{
if (MaxSdk.IsInterstitialReady(interstitialADUnitID))
void GameConfig(bool result, string config)
{
// Debug.Log($"广告已经准备好,播放");
MaxSdk.ShowInterstitial(interstitialADUnitID, placement);
onInterstitialAdCompleted = onCompleted;
}
else
{
Debug.Log($"广告未准备好,不播放");
onCompleted?.Invoke(false);
}
}
static int retryAttemptInterstitial;
public static void InitializeInterstitialAds()
{
MaxSdkCallbacks.Interstitial.OnAdLoadedEvent += OnInterstitialLoadedEvent;
MaxSdkCallbacks.Interstitial.OnAdLoadFailedEvent += OnInterstitialLoadFailedEvent;
MaxSdkCallbacks.Interstitial.OnAdDisplayedEvent += OnInterstitialDisplayedEvent;
MaxSdkCallbacks.Interstitial.OnAdClickedEvent += OnInterstitialClickedEvent;
MaxSdkCallbacks.Interstitial.OnAdHiddenEvent += OnInterstitialHiddenEvent;
MaxSdkCallbacks.Interstitial.OnAdDisplayFailedEvent += OnInterstitialAdFailedToDisplayEvent;
MaxSdkCallbacks.Interstitial.OnAdRevenuePaidEvent += OnAdRevenuePaidEvent;
LoadInterstitial();
}
private static void LoadInterstitial()
{
MaxSdk.LoadInterstitial(interstitialADUnitID);
}
private static void OnInterstitialLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
retryAttemptInterstitial = 0;
}
private static void OnInterstitialLoadFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
{
retryAttemptInterstitial++;
double retryDelay = Math.Pow(2, Math.Min(6, retryAttemptInterstitial));
IsfvKit.StartAction("LoadInterstitial", LoadInterstitial, (float)retryDelay);
}
private static void OnInterstitialDisplayedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
}
private static void OnInterstitialAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo,
MaxSdkBase.AdInfo adInfo)
{
LoadInterstitial();
}
private static void OnInterstitialClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
}
private static void OnInterstitialHiddenEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
OnInterstitialAdRevenuePaidEvent(adUnitId, adInfo);
LoadInterstitial();
onInterstitialAdCompleted?.Invoke(true);
onInterstitialAdCompleted = null;
}
private static void OnInterstitialAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
string countryCode = "USD";//MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD"
// //string networkName = adInfo.NetworkName; // Display name of the network that showed the ad
// // string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
// //string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
// // string networkPlacement = adInfo.NetworkPlacement; // The placement ID from the network that showed the ad
adCallbackInfo.Clear();
var loginModel = GameHelper.GetLoginModel();
adCallbackInfo.Add("customer_user_id", loginModel.uid.ToString());
adCallbackInfo.Add("af_revenue", adInfo.Revenue.ToString());
adCallbackInfo.Add("af_currency", countryCode);
adCallbackInfo.Add("eventValue", "");
// AppsFlyer.sendEvent("af_pay", adCallbackInfo);
double revenue = Convert.ToDouble(PlayerPrefs.GetString($"adInfoRevenue_{loginModel.uid}", "0")); revenue += adInfo.Revenue;
// if (revenue >= RevenueThreshold)
// {
// adCallbackInfo["af_revenue"] = revenue.ToString();
// AppsFlyer.sendEvent("af_revenue", adCallbackInfo);
// PlayerPrefs.SetString($"adInfoRevenue_{loginModel.uid}", "0");
// bool isToday = GameHelper.IsToday(loginModel.reg_time);
// if (isToday)
// {
// adCallbackInfo["af_new_revenue"] = revenue.ToString();
// AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
// }
// }
// else
// {
// PlayerPrefs.SetString($"adInfoRevenue_{loginModel.uid}", revenue.ToString());
// }
}
#endregion
#region 广
public static UnityAction<bool> onVideoAdCompleted = null;
public static void ShowVideo(string placement = "DefaultVideo", UnityAction<bool> onCompleted = null)
{
#if UNITY_EDITOR
SaveData.GetSaveobject().look_ad_numbers++;
onCompleted?.Invoke(true);
#else
if (MaxSdk.IsRewardedAdReady(rewardedADUnitID))
{
MaxSdk.ShowRewardedAd(rewardedADUnitID, placement);
onVideoAdCompleted=onCompleted;
}
else
{
onCompleted?.Invoke(false);
Debug.Log($"************* game config result : {result}, config : {config}");
}
// SDK初始化方法
MYp0ZVTT2QSDKHelper.Instance.Init(null, null, GameConfig);
#endif
}
static int retryAttempt;
public static void InitializeRewardedAds()
public static void ShowInterstitial(string placement = "DefaultInterstitial", UnityAction<bool> onCompleted = null)
{
MaxSdkCallbacks.Rewarded.OnAdLoadedEvent += OnRewardedAdLoadedEvent;
MaxSdkCallbacks.Rewarded.OnAdLoadFailedEvent += OnRewardedAdLoadFailedEvent;
MaxSdkCallbacks.Rewarded.OnAdDisplayedEvent += OnRewardedAdDisplayedEvent;
MaxSdkCallbacks.Rewarded.OnAdClickedEvent += OnRewardedAdClickedEvent;
MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent += OnRewardedAdRevenuePaidEvent;
MaxSdkCallbacks.Rewarded.OnAdHiddenEvent += OnRewardedAdHiddenEvent;
MaxSdkCallbacks.Rewarded.OnAdDisplayFailedEvent += OnRewardedAdFailedToDisplayEvent;
MaxSdkCallbacks.Rewarded.OnAdReceivedRewardEvent += OnRewardedAdReceivedRewardEvent;
MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent += OnAdRevenuePaidEvent;
LoadRewardedAd();
}
public static UnityAction<bool> onVideoAdCompleted = null;
private static string _placement = "";
private static Coroutine _waitForVideoAd = null;
private static void LoadRewardedAd()
public static void ShowVideo(string placement = "DefaultVideo", UnityAction<bool> onCompleted = null)
{
MaxSdk.LoadRewardedAd(rewardedADUnitID);
}
public static string user_id = "";
private static void OnAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
//string countryCode = MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD"
// //string networkName = adInfo.NetworkName; // Display name of the network that showed the ad
// // string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
// //string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
// // string networkPlacement = adInfo.NetworkPlacement; // The placement ID from the network that showed the ad
string countryCode = "USD";
adCallbackInfo.Clear();
adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
adCallbackInfo.Add("customer_user_id", user_id);
adCallbackInfo.Add("af_currency", countryCode);
//广告收益上传(扣量)((用户累计收益大于0.1上报50%,50%可配置))
double revenue = Convert.ToDouble(PlayerPrefs.GetString($"adInfoRevenue_{user_id}", "0"));
revenue += adInfo.Revenue;
// Debug.Log($"revenue: {revenue} \n adInfo.Revenue: {adInfo.Revenue}");
if (revenue >= RevenueThreshold)
{
adCallbackInfo.Add("af_revenue", revenue.ToString());
AppsFlyer.sendEvent("af_ad_revenue", adCallbackInfo);
PlayerPrefs.SetString($"adInfoRevenue_{user_id}", "0");
int adrate = ConfigSystem.GetConfig<CommonModel>().adrate / 100;
double revenueAdrate = revenue * adrate;
adCallbackInfo["af_revenue"] = revenueAdrate.ToString();
AppsFlyer.sendEvent("Af_new_ad_revenue", adCallbackInfo);
}
else
{
PlayerPrefs.SetString($"adInfoRevenue_{user_id}", revenue.ToString());
}
int highSend;
if (!PlayerPrefs.HasKey($"sendHighRevenue_{user_id}"))
{
highSend = 0; // 如果不存在,则初始化为 0
}
else
{
highSend = PlayerPrefs.GetInt($"sendHighRevenue_{user_id}", 0); // 从 PlayerPrefs 中获取
}
// 判断是否需要发送高收入事件
// Debug.Log($"highSend=====: {highSend}");
if (highSend == 0)
{
float limitNum = GameHelper.GetCommonModel().afSendLimit;
var totalNum = Convert.ToDouble(PlayerPrefs.GetString($"adRevenueTotal_{user_id}", "0"));
totalNum += adInfo.Revenue;
// Debug.Log($"totalNum=====: {totalNum} {limitNum}");
if (totalNum >= limitNum)
{
GameHelper.sendHighRevenueToAF(); // 发送高收入事件
PlayerPrefs.SetInt($"sendHighRevenue_{user_id}", 1); // 标记已发送
}
else
{
PlayerPrefs.SetString($"adRevenueTotal_{user_id}", totalNum.ToString());
}
}
}
private static void OnRewardedAdLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
retryAttempt = 0;
}
private static void OnRewardedAdLoadFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
{
retryAttempt++;
double retryDelay = Math.Pow(2, Math.Min(6, retryAttempt));
IsfvKit .StartAction("LoadRewardedAd", LoadRewardedAd, (float)retryDelay);
}
private static void OnRewardedAdDisplayedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
}
private static void OnRewardedAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo,
MaxSdkBase.AdInfo adInfo)
{
LoadRewardedAd();
}
private static void OnRewardedAdClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
}
private static void OnRewardedAdHiddenEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
LoadRewardedAd();
SaveData.GetSaveobject().look_ad_numbers++;
onVideoAdCompleted = onCompleted;
_placement = placement;
#if UNITY_EDITOR
onVideoAdCompleted?.Invoke(true);
onVideoAdCompleted = null;
if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveobject().is_get_removead && (UnityEngine.Random.Range(0, 100) < GameHelper.GetCommonModel().rewardinsertion))
#else
// TrackKit.SendEvent(VideoBehaviorTrack.Event, VideoBehaviorTrack.Property.watch_ad_people);
// TrackKit.SendEvent(VideoBehaviorTrack.Event, VideoBehaviorTrack.Property.Rewarded_videos_trigger_number);
if (CheckRewardedReady())
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.afterRewardAdShow, 1);
Debug.Log("bofanggggggggggggggreward");
GameHelper.ShowInterstitial("AfterReward");
MYp0ZVTT2QSDKHelper.Instance.ShowRewardVideo(_placement, b =>
{
DOVirtual.DelayedCall(0.1f, () =>
{
onVideoAdCompleted?.Invoke(b);
});
}, ()=>
{
DOVirtual.DelayedCall(0.2f, () =>
{
Debug.Log($"激励广告关闭");
if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveobject().is_get_removead && (UnityEngine.Random.Range(0, 100) < GameHelper.GetCommonModel().rewardinsertion))
{
// TrackKit.SendEvent(ADEventTrack.Event, ADEventTrack.Property.afterRewardAdShow);
GameHelper.ShowInterstitial("AfterReward");
}
});
});
}
}
private static void OnRewardedAdReceivedRewardEvent(string adUnitId, MaxSdk.Reward reward,
MaxSdkBase.AdInfo adInfo)
{
else
{
onVideoAdCompleted?.Invoke(false);
}
#endif
}
private static void OnRewardedAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{
}
#endregion
}
}
+591 -167
View File
@@ -60,137 +60,138 @@ namespace DontConfuse
public void OpenWebView(string url)
{
//Debug.Log("[WebviewManager] OpenWebView");
// #if UNITY_IOS && !UNITY_EDITOR
// BrigdeIOS.OpenWebview(url);
// #endif
#if UNITY_IOS && !UNITY_EDITOR
BrigdeIOS.OpenWebview(url);
#endif
}
public void showDarkWebview()
{
//Debug.Log("[WebviewManager] OpenWebView");
// #if UNITY_IOS && !UNITY_EDITOR
// BrigdeIOS.showDarkWebview();
// #endif
#if UNITY_IOS && !UNITY_EDITOR
BrigdeIOS.showDarkWebview();
#endif
}
public void CloseWebview()
{
//Debug.Log("[WebviewManager] CloseWebview");
// #if UNITY_IOS && !UNITY_EDITOR
// BrigdeIOS.CloseWebview();
// #endif
#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
#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
#if UNITY_IOS && !UNITY_EDITOR
BrigdeIOS.SetPadding(left, top, right, bottom);
#endif
}
public void SetDarkThough(bool though)
{
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;
}
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
#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
#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
#if UNITY_IOS && !UNITY_EDITOR
BrigdeIOS.SetCTEnable(flag);
#endif
}
public void SetFullScreen()
{
// Debug.Log("[WebviewManager] SetFullScreen");
// #if UNITY_IOS && !UNITY_EDITOR
// BrigdeIOS.SetFullScreen();
// #endif
#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
#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
#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
// 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
#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
#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
#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
#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
#if UNITY_IOS && !UNITY_EDITOR
BrigdeIOS.setRewardBtnTag(flag);
#endif
}
public void ObjC_TouchClick(string name)
@@ -200,13 +201,395 @@ namespace DontConfuse
}
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.GetConfig<CommonModel>().darkWVRefreshtime.Length; i++)
// {
// if (i != 0) darkWVRefreshtime_str += "|";
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime[i].ToString();
// }
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2.Length; i++)
// {
// darkWVRefreshtime_str += "|";
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2[i].ToString();
// }
int dark_type = -1;
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
{
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
{
if (i != 0) darkWVRefreshtime_str += "|";
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[0];
darkWVRefreshtime_str += "|";
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[1];
dark_type = ConfigSystem.dark_weblist[i].wvType;
}
}
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
// {
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i].ToString();
// }
dark_type = -1;
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
{
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
{
if (i != 0) darkWVDailyrefreshtimes_str += "|";
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes;
dark_type = ConfigSystem.dark_weblist[i].wvType;
}
}
WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig<CommonModel>().flyCtRate, ConfigSystem.GetConfig<CommonModel>().otherH5switch,
ConfigSystem.GetConfig<CommonModel>().H5Refreshtime, ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes, ConfigSystem.GetConfig<CommonModel>().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.GetConfig<CommonModel>().darkWVRefreshtime.Length; i++)
// {
// if (i != 0) darkWVRefreshtime_str += "|";
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime[i].ToString();
// }
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2.Length; i++)
// {
// darkWVRefreshtime_str += "|";
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2[i].ToString();
// }
int dark_type = -1;
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
{
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
{
if (i != 0) darkWVRefreshtime_str += "|";
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[0];
darkWVRefreshtime_str += "|";
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[1];
dark_type = ConfigSystem.dark_weblist[i].wvType;
}
}
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
// {
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i].ToString();
// }
dark_type = -1;
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
{
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
{
if (i != 0) darkWVDailyrefreshtimes_str += "|";
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes;
dark_type = ConfigSystem.dark_weblist[i].wvType;
}
}
WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig<CommonModel>().flyCtRate, ConfigSystem.GetConfig<CommonModel>().otherH5switch,
ConfigSystem.GetConfig<CommonModel>().H5Refreshtime, ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes, ConfigSystem.GetConfig<CommonModel>().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")
{
H5sendClass info = new H5sendClass() { link = temp_array[0], type = "h5" };
NetworkKit.PostWithHeader<H5refreshTimes>("event/h5Impressions", info, (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" };
NetworkKit.PostWithHeader<H5refreshTimes>("event/h5Impressions", info, (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 Camera orthoCamera;
public void TouchClickPoint(string name)
{
// Debug.Log("TouchClickPoint" + name);
if (name == null) return;
if (name == "flyBtn")
{
NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.fly_ct_number, 1);
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.fly_ct_people,1);
}
if (name == "rewardBtn")
{
NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_ct_number, 1);
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.annular_ct_people,1);
}
if (name == "finish")
{
NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_finish_number, 1);
}
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)
@@ -223,127 +606,147 @@ 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<CommonModel>().Dailyrefreshtimes -
// PlayerPrefs.GetInt("Dailyrefreshnum", 0);
// }
// else
// {
// PlayerPrefs.SetInt("Dailyrefreshnum", 0);
// Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes;
// PlayerPrefs.SetInt("Dayreftimes", newDays);
// }
if (last_time == newDays)
{
Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes -
PlayerPrefs.GetInt("Dailyrefreshnum", 0);
}
else
{
PlayerPrefs.SetInt("Dailyrefreshnum", 0);
Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().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 List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0,0};
}
// if (dark_last_time == dark_newDays)
// {
// // dark_Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[Int32.Parse(webview_index) - 1] -
// // PlayerPrefs.GetInt("dark_Dayref", 0);
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
// {
if (dark_last_time == dark_newDays)
{
// dark_Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[Int32.Parse(webview_index) - 1] -
// PlayerPrefs.GetInt("dark_Dayref", 0);
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
// {
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i] - SaveData.GetSaveobject().dark_Dayref[i];
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().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<CommonModel>().darkWVDailyrefreshtimes[Int32.Parse(webview_index)];
// }
int dark_type_ = -1;
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
{
if (dark_type_ != ConfigSystem.dark_weblist[i].wvType)
{
dark_type_ = ConfigSystem.dark_weblist[i].wvType;
if (i != 0) darkWVDailyrefreshtimes_str += "|";
Debug.Log(dark_type_);
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes - SaveData.GetSaveobject().dark_Dayref[dark_type_ - 1];
}
}
}
else
{
// PlayerPrefs.SetInt("dark_Dayref", 0);
for (int i = 0; i < SaveData.GetSaveobject().dark_Dayref.Count; i++)
{
SaveData.GetSaveobject().dark_Dayref[i] = 0;
}
SaveData.saveDataFunc();
// dark_Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[Int32.Parse(webview_index)];
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
// {
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
// {
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i];
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i];
// }
// }
int dark_type_ = -1;
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
{
if (dark_type_ != ConfigSystem.dark_weblist[i].wvType)
{
dark_type_ = ConfigSystem.dark_weblist[i].wvType;
if (i != 0) darkWVDailyrefreshtimes_str += "|";
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes;
}
}
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].WVOffset ;
}
// string darkWVRefreshtime_str = "";
string darkWVRefreshtime_str = "";
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime.Length; i++)
@@ -356,21 +759,42 @@ namespace DontConfuse
// darkWVRefreshtime_str += "|";
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2[i].ToString();
// }
int dark_type = -1;
string add_time = "";
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
{
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
{
if (i != 0)
{
darkWVRefreshtime_str += "|";
add_time += "|";
}
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[0];
darkWVRefreshtime_str += "|";
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[1];
dark_type = ConfigSystem.dark_weblist[i].wvType;
add_time += ConfigSystem.dark_weblist[i].WVClickAddTime;
}
}
Debug.Log("--------------------------------");
// Debug.Log("--------------------------------");
// add_time+= ConfigSystem.GetConfig<CommonModel>().WVClickAddTime[0] + "|" + ConfigSystem.GetConfig<CommonModel>().WVClickAddTime[1];
// string add_time = ConfigSystem.GetConfig<CommonModel>().WVClickCTAddTime1[0] + "|" +
// ConfigSystem.GetConfig<CommonModel>().WVClickCTAddTime1[1] + "|" + ConfigSystem.GetConfig<CommonModel>().WVClickCTAddTime2[0] + "|" + ConfigSystem.GetConfig<CommonModel>().WVClickCTAddTime2[1];
// Debug.Log(add_time);
// WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig<CommonModel>().flyCtRate, ConfigSystem.GetConfig<CommonModel>().otherH5switch,
// ConfigSystem.GetConfig<CommonModel>().H5Refreshtime, Dailyrefresh_reamain, ConfigSystem.GetConfig<CommonModel>().darkThoughProbability
// , darkWVRefreshtime_str, darkWVDailyrefreshtimes_str, dark_str, light_str, GameHelper.IsGiftSwitch(), ConfigSystem.web_through_str, add_time);
Debug.Log(add_time);
Debug.Log(darkWVRefreshtime_str);
Debug.Log(darkWVDailyrefreshtimes_str);
Debug.Log(dark_str);
Debug.Log(ConfigSystem.web_through_str);
WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig<CommonModel>().flyCtRate, ConfigSystem.GetConfig<CommonModel>().otherH5switch,
ConfigSystem.GetConfig<CommonModel>().H5Refreshtime, Dailyrefresh_reamain, ConfigSystem.GetConfig<CommonModel>().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<CommonModel>().flyCtRate);
// RefreshDataCT(isTop, gameUrlInfo);
}
public void ClickAdEvent(string ad_msg)
{
string[] temp_array = ad_msg.Split("|");