fix:1、删除sdk相关。2、添加tips界面,修复bug
This commit is contained in:
@@ -1,164 +1,164 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using AppsFlyerSDK;
|
||||
using ChillConnect;
|
||||
using DG.Tweening;
|
||||
using SGModule.Common.Helper;
|
||||
using SGModule.Net;
|
||||
using SGModule.NetKit;
|
||||
// using Unity.Advertisement.IosSupport;
|
||||
using UnityEngine;
|
||||
|
||||
namespace IgnoreOPS
|
||||
{
|
||||
|
||||
internal class AppsFlyerObjectScript1 : MonoBehaviour, IAppsFlyerConversionData
|
||||
{
|
||||
public string appID;
|
||||
public bool is_init;
|
||||
public Coroutine m_Coroutine;
|
||||
|
||||
void Start()
|
||||
{
|
||||
AddListener();
|
||||
|
||||
AppsFlyer.setIsDebug(true);
|
||||
// #if UNITY_IOS && !UNITY_EDITOR
|
||||
// appID = "6746832797";
|
||||
// using System;
|
||||
// using System.Collections;
|
||||
// using System.Collections.Generic;
|
||||
// // using AppsFlyerSDK;
|
||||
// using ChillConnect;
|
||||
// using DG.Tweening;
|
||||
// using SGModule.Common.Helper;
|
||||
// using SGModule.Net;
|
||||
// using SGModule.NetKit;
|
||||
// // using Unity.Advertisement.IosSupport;
|
||||
// using UnityEngine;
|
||||
//
|
||||
// namespace IgnoreOPS
|
||||
// {
|
||||
//
|
||||
// internal class AppsFlyerObjectScript1 : MonoBehaviour, IAppsFlyerConversionData
|
||||
// {
|
||||
// public string appID;
|
||||
// public bool is_init;
|
||||
// public Coroutine m_Coroutine;
|
||||
//
|
||||
// void Start()
|
||||
// {
|
||||
// AddListener();
|
||||
//
|
||||
// AppsFlyer.setIsDebug(true);
|
||||
// // #if UNITY_IOS && !UNITY_EDITOR
|
||||
// // appID = "6746832797";
|
||||
// // m_Coroutine = CrazyAsyKit.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 OnDestroy()
|
||||
// {
|
||||
// RemoveListener();
|
||||
// }
|
||||
//
|
||||
// void RequestLogin(object obj = null)
|
||||
// {
|
||||
// if (GameHelper.IsConnect())
|
||||
// {
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Network_reconnection);
|
||||
// }
|
||||
//
|
||||
// CrazyAsyKit.StopCoroutine(m_Coroutine);
|
||||
//
|
||||
// m_Coroutine = CrazyAsyKit.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 OnDestroy()
|
||||
{
|
||||
RemoveListener();
|
||||
}
|
||||
|
||||
void RequestLogin(object obj = null)
|
||||
{
|
||||
if (GameHelper.IsConnect())
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Network_reconnection);
|
||||
}
|
||||
|
||||
CrazyAsyKit.StopCoroutine(m_Coroutine);
|
||||
|
||||
m_Coroutine = CrazyAsyKit.StartCoroutine(loopWaitInitAf());
|
||||
}
|
||||
|
||||
private IEnumerator loopWaitInitAf()
|
||||
{
|
||||
// yield return new WaitForSeconds(0.5f);
|
||||
// #if !ChillConnectRelease
|
||||
// if (!GameHelper.IsConnect()) GameHelper.ShowTips($"is link network:{GameHelper.IsConnect()}");
|
||||
// #endif
|
||||
var isConnect = GameHelper.IsConnect();
|
||||
if (!isConnect)
|
||||
{
|
||||
float retryTime = 0f;
|
||||
const float maxRetryTime = 3f;
|
||||
|
||||
while (!GameHelper.IsConnect() && retryTime < maxRetryTime)
|
||||
{
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
retryTime += 0.2f;
|
||||
}
|
||||
|
||||
// 再次确认网络状态
|
||||
isConnect = GameHelper.IsConnect();
|
||||
|
||||
if (!isConnect)
|
||||
{
|
||||
// 超时且仍未连接,触发无网络提示
|
||||
Action action = () =>
|
||||
{
|
||||
TimerHelper.mEasy.AddTimer(0.5f, () =>
|
||||
{
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.NotNetwork);
|
||||
});
|
||||
};
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open, action);
|
||||
}
|
||||
}
|
||||
if (isConnect)
|
||||
{
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.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("ZRPEXnZD9jgqWx8RmiQbiT", appID, this);
|
||||
AppsFlyer.startSDK();
|
||||
// AppsFlyer.AFLog("8888888888888888888",
|
||||
// ATTrackingStatusBinding.GetAuthorizationTrackingStatus().ToString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onConversionDataSuccess(string conversionData)
|
||||
{
|
||||
Debug.Log($"[AF] onConversionDataSuccess-------- {is_init}");
|
||||
if (is_init) return;
|
||||
is_init = true;
|
||||
AppsFlyer.AFLog("onConversionDataSuccess", conversionData);
|
||||
var conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
|
||||
var json = SerializeUtil.ToJsonIndented(conversionDataDictionary);
|
||||
SuperApplication.Instance.attribution =
|
||||
conversionDataDictionary.TryGetValue("af_status", out var afStatus)
|
||||
? afStatus.ToString().ToLower()
|
||||
: "organic";
|
||||
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "success");
|
||||
}
|
||||
|
||||
public void onConversionDataFail(string error)
|
||||
{
|
||||
Debug.Log($"[AF] onConversionDataFail-------- {is_init}");
|
||||
if (is_init) return;
|
||||
is_init = true;
|
||||
AppsFlyer.AFLog("onConversionDataFail", error);
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "fail");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
//
|
||||
// private IEnumerator loopWaitInitAf()
|
||||
// {
|
||||
// // yield return new WaitForSeconds(0.5f);
|
||||
// // #if !ChillConnectRelease
|
||||
// // if (!GameHelper.IsConnect()) GameHelper.ShowTips($"is link network:{GameHelper.IsConnect()}");
|
||||
// // #endif
|
||||
// var isConnect = GameHelper.IsConnect();
|
||||
// if (!isConnect)
|
||||
// {
|
||||
// float retryTime = 0f;
|
||||
// const float maxRetryTime = 3f;
|
||||
//
|
||||
// while (!GameHelper.IsConnect() && retryTime < maxRetryTime)
|
||||
// {
|
||||
// yield return new WaitForSeconds(0.2f);
|
||||
// retryTime += 0.2f;
|
||||
// }
|
||||
//
|
||||
// // 再次确认网络状态
|
||||
// isConnect = GameHelper.IsConnect();
|
||||
//
|
||||
// if (!isConnect)
|
||||
// {
|
||||
// // 超时且仍未连接,触发无网络提示
|
||||
// Action action = () =>
|
||||
// {
|
||||
// TimerHelper.mEasy.AddTimer(0.5f, () =>
|
||||
// {
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.NotNetwork);
|
||||
// });
|
||||
// };
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open, action);
|
||||
// }
|
||||
// }
|
||||
// if (isConnect)
|
||||
// {
|
||||
// TrackKit.TrackLoginFunnel(LoginFunnelEventType.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("ZRPEXnZD9jgqWx8RmiQbiT", appID, this);
|
||||
// AppsFlyer.startSDK();
|
||||
// // AppsFlyer.AFLog("8888888888888888888",
|
||||
// // ATTrackingStatusBinding.GetAuthorizationTrackingStatus().ToString());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public void onConversionDataSuccess(string conversionData)
|
||||
// {
|
||||
// Debug.Log($"[AF] onConversionDataSuccess-------- {is_init}");
|
||||
// if (is_init) return;
|
||||
// is_init = true;
|
||||
// AppsFlyer.AFLog("onConversionDataSuccess", conversionData);
|
||||
// var conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
|
||||
// var json = SerializeUtil.ToJsonIndented(conversionDataDictionary);
|
||||
// SuperApplication.Instance.attribution =
|
||||
// conversionDataDictionary.TryGetValue("af_status", out var afStatus)
|
||||
// ? afStatus.ToString().ToLower()
|
||||
// : "organic";
|
||||
//
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
// TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "success");
|
||||
// }
|
||||
//
|
||||
// public void onConversionDataFail(string error)
|
||||
// {
|
||||
// Debug.Log($"[AF] onConversionDataFail-------- {is_init}");
|
||||
// if (is_init) return;
|
||||
// is_init = true;
|
||||
// AppsFlyer.AFLog("onConversionDataFail", error);
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
// TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "fail");
|
||||
// }
|
||||
//
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class BrigdeIOS
|
||||
{
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void copyText(string text);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SaveVideoWithCustomDate(string videoPath);
|
||||
[DllImport("__Internal")]
|
||||
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,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b696b07f93466c74788643a5e11a254e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -38,6 +38,6 @@ public static partial class DataKeys
|
||||
public const string ApplePayTransactionID = "ApplePayTransactionID"; //ios购买后的非消耗性订单id
|
||||
public const string NewWatchCd = "NewWatchCd";
|
||||
public const string ArrowResultLevel = "ArrowResultLevel"; //箭头游戏的结算等级(1:免费,0:看广告)
|
||||
public const string ArrowDarkTheme = "ArrowDarkTheme"; //箭头游戏的黑夜模式(1:开启,0:关闭)
|
||||
public const string ArrowDarkTheme = "ArrowDarkTheme"; //箭头游戏的黑夜模式(0:黑夜,1:白天)
|
||||
public const string ArrowTheme = "ArrowTheme"; //箭头游戏的主题(0:黑色 1:虫子 2:彩色)
|
||||
}
|
||||
|
||||
+29
-29
@@ -77,9 +77,9 @@ namespace ChillConnect
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.AppManagerRegister);
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.InitUIMgr);
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
#if UNITY_EDITOR
|
||||
// #if UNITY_EDITOR
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
#endif
|
||||
// #endif
|
||||
AppDispatcher.Instance.AddListener(AppMsg.LoginInit, OnLoadingComplete);
|
||||
|
||||
// DataMgr.InitPreferences();
|
||||
@@ -99,33 +99,33 @@ namespace ChillConnect
|
||||
SaveingPotHelper.CheckSaveingPot();
|
||||
SaveingPotHelper.TestingClearTime();
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
WebviewManager.Instance.SetFullScreen();
|
||||
int flyswitch = ConfigSystem.GetConfig<CommonModel>().flyswitch;
|
||||
int propswitch = ConfigSystem.GetConfig<CommonModel>().propswitch;
|
||||
|
||||
int offset_y = ConfigSystem.GetConfig<CommonModel>().WVOffset[0];
|
||||
int offset_y1 = ConfigSystem.GetConfig<CommonModel>().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.GetConfig<CommonModel>().propCoord[0], ConfigSystem.GetConfig<CommonModel>().propCoord[1], 60, 60);
|
||||
}
|
||||
// if (GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// WebviewManager.Instance.SetFullScreen();
|
||||
// int flyswitch = ConfigSystem.GetConfig<CommonModel>().flyswitch;
|
||||
// int propswitch = ConfigSystem.GetConfig<CommonModel>().propswitch;
|
||||
//
|
||||
// int offset_y = ConfigSystem.GetConfig<CommonModel>().WVOffset[0];
|
||||
// int offset_y1 = ConfigSystem.GetConfig<CommonModel>().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.GetConfig<CommonModel>().propCoord[0], ConfigSystem.GetConfig<CommonModel>().propCoord[1], 60, 60);
|
||||
// }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class MaxPayManager
|
||||
paydata.status = 1;
|
||||
SavePayData(response.Data.order_id, paydata);
|
||||
isPay = true;
|
||||
OpenBrowser.OpenURL(response.Data.pay_url);
|
||||
Application.OpenURL(response.Data.pay_url);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace ChillConnect
|
||||
public const string ArrowGameCtrl = "ArrowGameCtrl";
|
||||
public const string GameAgainCtrl = "GameAgainCtrl";
|
||||
public const string ArrowThemeCtrl = "ArrowThemeCtrl";
|
||||
public const string ArrowTipsCtrl = "ArrowTipsCtrl";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,7 @@ namespace ChillConnect
|
||||
public const string ArrowGameModel = "ArrowGameModel";
|
||||
public const string GameAgainModel = "GameAgainModel";
|
||||
public const string ArrowThemeModel = "ArrowThemeModel";
|
||||
public const string ArrowTipsModel = "ArrowTipsModel";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@ namespace ChillConnect
|
||||
moduleManager.AddModel(ModelConst.ArrowGameModel, new ArrowGameModel());
|
||||
moduleManager.AddModel(ModelConst.GameAgainModel, new GameAgainModel());
|
||||
moduleManager.AddModel(ModelConst.ArrowThemeModel, new ArrowThemeModel());
|
||||
moduleManager.AddModel(ModelConst.ArrowTipsModel, new ArrowTipsModel());
|
||||
|
||||
|
||||
}
|
||||
@@ -120,6 +121,7 @@ namespace ChillConnect
|
||||
moduleManager.AddUICtrl(UICtrlConst.ArrowGameUICtrl, new ArrowGameUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.GameAgainUICtrl, new GameAgainUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ArrowThemeUICtrl, new ArrowThemeUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ArrowTipsUICtrl, new ArrowTipsUICtrl());
|
||||
|
||||
|
||||
|
||||
@@ -182,6 +184,7 @@ namespace ChillConnect
|
||||
moduleManager.AddCtrl(CtrlConst.ArrowGameCtrl, new ArrowGameCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.GameAgainCtrl, new GameAgainCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ArrowThemeCtrl, new ArrowThemeCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ArrowTipsCtrl, new ArrowTipsCtrl());
|
||||
|
||||
}
|
||||
|
||||
@@ -242,6 +245,7 @@ namespace ChillConnect
|
||||
moduleManager.AddUIType(UIConst.ArrowGameUI, typeof(ArrowGameUI));
|
||||
moduleManager.AddUIType(UIConst.GameAgainUI, typeof(GameAgainUI));
|
||||
moduleManager.AddUIType(UIConst.ArrowThemeUI, typeof(ArrowThemeUI));
|
||||
moduleManager.AddUIType(UIConst.ArrowTipsUI, typeof(ArrowTipsUI));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace ChillConnect
|
||||
public const string ArrowGameUI = "ArrowGameUI";
|
||||
public const string GameAgainUI = "GameAgainUI";
|
||||
public const string ArrowThemeUI = "ArrowThemeUI";
|
||||
public const string ArrowTipsUI = "ArrowTipsUI";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,7 @@ namespace ChillConnect
|
||||
public const string ArrowGameUICtrl = "ArrowGameUICtrl";
|
||||
public const string GameAgainUICtrl = "GameAgainUICtrl";
|
||||
public const string ArrowThemeUICtrl = "ArrowThemeUICtrl";
|
||||
public const string ArrowTipsUICtrl = "ArrowTipsUICtrl";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,21 @@ namespace ChillConnect
|
||||
// 所有网格圆点实例列表,用于批量改色/清理
|
||||
private List<ArrorPoint> _gridDotList = new List<ArrorPoint>();
|
||||
|
||||
#region 箭头颜色配置
|
||||
// 8种预设彩色,可按需调整色值
|
||||
private readonly Color[] _colorfulPalette = new Color[]
|
||||
{
|
||||
new Color(1f, 0.3f, 0.3f), // 红
|
||||
new Color(1f, 0.6f, 0.2f), // 橙
|
||||
new Color(1f, 0.9f, 0.2f), // 黄
|
||||
new Color(0.3f, 0.8f, 0.4f), // 绿
|
||||
new Color(0.2f, 0.8f, 0.9f), // 青
|
||||
new Color(0.3f, 0.5f, 1f), // 蓝
|
||||
new Color(0.7f, 0.4f, 1f), // 紫
|
||||
new Color(1f, 0.5f, 0.8f) // 粉
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region 缩放、拖拽、滑动条 全局变量
|
||||
// 缩放阈值(滑动条左右边界对应这两个值)
|
||||
private readonly float _minScale = 0.6f;
|
||||
@@ -257,7 +272,8 @@ namespace ChillConnect
|
||||
else if (InputHelper.Instance.TouchCount == 1)
|
||||
{
|
||||
Touch touch = InputHelper.Instance.GetTouch(0);
|
||||
Vector2 curTouchPos = touch.position;
|
||||
// 触摸坐标和鼠标同属Unity屏幕坐标系,统一转成FGUI坐标系
|
||||
Vector2 curTouchPos = UnityMouseToFGUIPos(touch.position);
|
||||
|
||||
if (touch.phase == TouchPhase.Began)
|
||||
{
|
||||
@@ -327,6 +343,10 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.AddListener(GameMsg.reset_game, OnRestartGame);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Update102, SetTopCurr);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Update101, SetTopCurr);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.ThemeChange, SetModel);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.UpdateSpeed, SetSpeed);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.SetDelete, SetDeleteMode);
|
||||
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
@@ -334,6 +354,12 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.reset_game, OnRestartGame);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Update102, SetTopCurr);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Update101, SetTopCurr);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.ThemeChange, SetModel);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.UpdateSpeed, SetSpeed);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.SetDelete, SetDeleteMode);
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -345,13 +371,18 @@ namespace ChillConnect
|
||||
_isTwoFingerTouch = false;
|
||||
_isDraging = false;
|
||||
|
||||
SetModel();
|
||||
|
||||
ui.text_level.SetVar("lv", GameHelper.GetLevel().ToString()).FlushVars();
|
||||
|
||||
// 按钮点击事件绑定
|
||||
OnBtnClickBindEvent();
|
||||
|
||||
//爱心重新更新显示
|
||||
for (int i = _heartCount; i > 0; i--)
|
||||
{
|
||||
ui.HeartsPanel.GetChild($"xin_{i}").visible = true;
|
||||
}
|
||||
|
||||
|
||||
_fingerTipObj = com_finger.CreateInstance();
|
||||
_viewContainer.AddChild(_fingerTipObj);
|
||||
@@ -401,6 +432,7 @@ namespace ChillConnect
|
||||
|
||||
_initComplete = true;
|
||||
|
||||
SetModel();
|
||||
|
||||
SetTopCurr();
|
||||
|
||||
@@ -437,6 +469,11 @@ namespace ChillConnect
|
||||
ui.com_bottom.btn_clear.SetClick(OnClickDeleteItem);
|
||||
ui.com_bottom.btn_hint.SetClick(OnClickHint);
|
||||
|
||||
ui.com_bottom.btn_setting.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.PersonViewUI_Open, _moveSpeed);
|
||||
});
|
||||
|
||||
ui.com_bottom.btn_skin.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.ArrowThemeUI_Open); });
|
||||
|
||||
ui.btn_petty.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.PettyAwardUI_Open); });
|
||||
@@ -448,35 +485,51 @@ namespace ChillConnect
|
||||
ui.btn_saveingpot.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.SaveingPotUI_Open); });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换模式 默认黑夜模式
|
||||
/// </summary>
|
||||
/// <param name="mod">true:白天 false:黑夜</param>
|
||||
private void SetModel(object mod = null)
|
||||
{
|
||||
int idx = 0;
|
||||
if (mod != null)
|
||||
{
|
||||
idx = (bool)mod? 1 : 0;
|
||||
}
|
||||
|
||||
ui.mode.selectedIndex = idx;
|
||||
|
||||
// 同步更新网格圆点颜色
|
||||
bool isDayMode = idx == 1;
|
||||
UpdateGridDotColor(isDayMode);
|
||||
// 缓存上一次箭头主题,用于判断是否需要重新随机彩色
|
||||
private int _lastArrowTheme = -1;
|
||||
/// <summary>
|
||||
/// 主题变更统一回调(昼夜/箭头主题切换都会触发)
|
||||
/// </summary>
|
||||
private void SetModel(object a = null)
|
||||
{
|
||||
int darkThemeIdx = DataMgr.ArrowDarkTheme.Value;
|
||||
int currentArrowTheme = DataMgr.ArrowTheme.Value;
|
||||
|
||||
ui.mode.selectedIndex = darkThemeIdx;
|
||||
|
||||
// 1. 更新网格圆点昼夜配色
|
||||
bool isDarkMode = darkThemeIdx == 0; // 0=黑夜
|
||||
Debug.Log($"ArrowDarkTheme==={darkThemeIdx}");
|
||||
UpdateGridDotColor(isDarkMode);
|
||||
|
||||
// 2. 判断是否需要重新随机彩色:只有从非彩色切到彩色时才刷新
|
||||
bool forceRandomColorful = currentArrowTheme == 2 && _lastArrowTheme != currentArrowTheme;
|
||||
|
||||
// 3. 更新所有箭头颜色
|
||||
UpdateAllArrowsColor(forceRandomColorful);
|
||||
|
||||
// 4. 更新缓存,用于下次对比
|
||||
_lastArrowTheme = currentArrowTheme;
|
||||
|
||||
Debug.Log($"主题刷新完成:昼夜={darkThemeIdx},箭头主题={currentArrowTheme}");
|
||||
}
|
||||
/// <summary>
|
||||
/// 批量设置网格圆点颜色(随昼夜模式切换)
|
||||
/// // 色值映射:白天#2c3a62,黑夜#d4e3f2
|
||||
/// </summary>
|
||||
/// <param name="isDay">true=白天模式,false=黑夜模式</param>
|
||||
/// <param name="isDay">true=黑夜模式,false=白天模式</param>
|
||||
|
||||
private string DarkColor = "#d4e3f2";
|
||||
private string LightColor = "#2c3a62";
|
||||
private void UpdateGridDotColor(bool isDay)
|
||||
{
|
||||
if (_gridDotList == null || _gridDotList.Count == 0)
|
||||
return;
|
||||
|
||||
// 色值映射:白天#2c3a62,黑夜#d4e3f2
|
||||
string colorHex = isDay ? "#2c3a62" : "#d4e3f2";
|
||||
|
||||
Debug.Log($"isDay=========={isDay}");
|
||||
string colorHex = isDay ? DarkColor : LightColor;
|
||||
ColorUtility.TryParseHtmlString(colorHex, out Color targetColor);
|
||||
|
||||
foreach (var dot in _gridDotList)
|
||||
@@ -486,6 +539,77 @@ namespace ChillConnect
|
||||
dot.point.color = targetColor;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据当前主题,为单个箭头生成对应颜色
|
||||
/// </summary>
|
||||
/// <param name="arrow">箭头配置对象</param>
|
||||
/// <param name="isRandomNew">彩色模式下是否重新随机颜色</param>
|
||||
private Color GetArrowRuntimeColor(ArrowConfig arrow, bool isRandomNew = false)
|
||||
{
|
||||
int themeType = DataMgr.ArrowTheme.Value;
|
||||
|
||||
// 0 = 纯色模式(黑色按钮):白天黑、黑夜白
|
||||
if (themeType == 0)
|
||||
{
|
||||
bool isDark = DataMgr.ArrowDarkTheme.Value == 0; // 0=黑夜
|
||||
return isDark ? Color.white : Color.black;
|
||||
}
|
||||
// 2 = 彩色随机模式
|
||||
else if (themeType == 2)
|
||||
{
|
||||
if (isRandomNew || arrow.runtimeColor == default)
|
||||
{
|
||||
int randomIndex = Random.Range(0, _colorfulPalette.Length);
|
||||
arrow.runtimeColor = _colorfulPalette[randomIndex];
|
||||
}
|
||||
return arrow.runtimeColor;
|
||||
}
|
||||
|
||||
// 兜底默认黑色
|
||||
return Color.black;
|
||||
}
|
||||
|
||||
/// 批量更新场上所有箭头的颜色(线条+单箭头)
|
||||
/// </summary>
|
||||
/// <param name="forceRandomColorful">彩色模式下是否强制重新随机</param>
|
||||
private void UpdateAllArrowsColor(bool forceRandomColorful = false)
|
||||
{
|
||||
if (_levelConfig == null || _levelConfig.arrows == null)
|
||||
return;
|
||||
|
||||
int themeType = DataMgr.ArrowTheme.Value;
|
||||
bool isColorfulMode = themeType == 2;
|
||||
|
||||
foreach (var arrow in _levelConfig.arrows)
|
||||
{
|
||||
// 只有强制刷新时,彩色模式才重新随机颜色
|
||||
bool isRandomNew = isColorfulMode && forceRandomColorful;
|
||||
Color targetColor = GetArrowRuntimeColor(arrow, isRandomNew);
|
||||
|
||||
// 更新线条颜色
|
||||
if (arrow.lineUnits != null)
|
||||
{
|
||||
foreach (var line in arrow.lineUnits)
|
||||
{
|
||||
if (line != null)
|
||||
{
|
||||
line.GetChild("line").asGraph.color = targetColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新单箭头颜色
|
||||
if (arrow.arrowObj != null)
|
||||
{
|
||||
GImage icon = arrow.arrowObj.GetChild("icon").asImage;
|
||||
if (icon != null)
|
||||
{
|
||||
icon.color = targetColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -583,8 +707,29 @@ namespace ChillConnect
|
||||
public static void InitAllLevelData()
|
||||
{
|
||||
string path = Path.Combine(Application.streamingAssetsPath, "all_levels.json");
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
// Android 平台需要使用 UnityWebRequest 读取 StreamingAssets
|
||||
using (UnityEngine.Networking.UnityWebRequest www = UnityEngine.Networking.UnityWebRequest.Get(path))
|
||||
{
|
||||
www.SendWebRequest();
|
||||
while (!www.isDone) { }
|
||||
|
||||
if (www.result == UnityEngine.Networking.UnityWebRequest.Result.Success)
|
||||
{
|
||||
string json = www.downloadHandler.text;
|
||||
_allLevelData = JsonUtility.FromJson<AllLevelRoot>(json);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Failed to load all_levels.json: {www.error}");
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Editor 和其他平台直接读取
|
||||
string json = File.ReadAllText(path);
|
||||
_allLevelData = JsonUtility.FromJson<AllLevelRoot>(json);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public static LevelConfig LoadLevelById(int targetLevelId)
|
||||
@@ -835,12 +980,13 @@ namespace ChillConnect
|
||||
if (tilePositions.Count > 0)
|
||||
tilePositions.RemoveAt(tilePositions.Count - 1);
|
||||
|
||||
ColorUtility.TryParseHtmlString(arrow.color, out Color lineColor);
|
||||
for (int i = 0; i < tilePositions.Count; i++)
|
||||
{
|
||||
Vector2 pos = tilePositions[i];
|
||||
LineTile unit = LineTile.CreateInstance();
|
||||
unit.SetPosition(pos.x, pos.y, 0);
|
||||
// 运行时主题取色
|
||||
Color lineColor = GetArrowRuntimeColor(arrow);
|
||||
unit.GetChild("line").asGraph.color = lineColor;
|
||||
unit.visible = true;
|
||||
unit.touchable = true;
|
||||
@@ -859,8 +1005,7 @@ namespace ChillConnect
|
||||
|
||||
|
||||
|
||||
// 在 CreateArrowAndLines 方法最后,补充这段初始化代码
|
||||
// ========== 新增:初始化距离偏移 ==========
|
||||
// ========== 初始化距离偏移 ==========
|
||||
arrow.movedDistance = 0f;
|
||||
// 轨迹总长度 = (点数-1) * 点间距
|
||||
arrow.trackTotalLength = (arrow.totalTrack.Count - 1) * 10f;
|
||||
@@ -878,21 +1023,27 @@ namespace ChillConnect
|
||||
|
||||
|
||||
#region 道具(删除和提示)
|
||||
private void SetDeleteMode(object a)
|
||||
{
|
||||
_isDeleteMode = !_isDeleteMode;
|
||||
}
|
||||
/// <summary>点击删除道具,开启/关闭删除模式</summary>
|
||||
private void OnClickDeleteItem()
|
||||
{
|
||||
_isDeleteMode = !_isDeleteMode;
|
||||
// _isDeleteMode = !_isDeleteMode;
|
||||
|
||||
// 可选:加提示,区分状态
|
||||
if (_isDeleteMode)
|
||||
{
|
||||
Debug.Log("已开启删除模式,点击箭头即可删除");
|
||||
// 可加UI提示:如图标高亮、文字提示
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("已关闭删除模式");
|
||||
}
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ArrowTipsUI_Open);
|
||||
|
||||
// // 可选:加提示,区分状态
|
||||
// if (_isDeleteMode)
|
||||
// {
|
||||
// Debug.Log("已开启删除模式,点击箭头即可删除");
|
||||
// // 可加UI提示:如图标高亮、文字提示
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Debug.Log("已关闭删除模式");
|
||||
// }
|
||||
}
|
||||
|
||||
private void OnClickHint()
|
||||
@@ -1219,7 +1370,8 @@ namespace ChillConnect
|
||||
arrowIns.rotation = DirToRotation(arrow.defaultDir);
|
||||
}
|
||||
|
||||
ColorUtility.TryParseHtmlString(arrow.color, out Color arrowColor);
|
||||
// 运行时主题取色
|
||||
Color arrowColor = GetArrowRuntimeColor(arrow);
|
||||
GImage icon = arrowIns.GetChild("icon").asImage;
|
||||
if (icon != null) icon.color = arrowColor;
|
||||
|
||||
@@ -1302,8 +1454,17 @@ namespace ChillConnect
|
||||
RunCoroutine(MoveAndDisappearCoroutine(arrow));
|
||||
}
|
||||
|
||||
|
||||
private void SetSpeed(object a = null)
|
||||
{
|
||||
if (a != null)
|
||||
{
|
||||
_moveSpeed = (float)a;
|
||||
}
|
||||
}
|
||||
|
||||
// 新增:统一移动速度(像素/秒),数值越大移动越快,可自由修改
|
||||
[SerializeField] private float _moveSpeed = 800f;
|
||||
[SerializeField] private float _moveSpeed = 1500f;
|
||||
|
||||
private IEnumerator MoveAndDisappearCoroutine(ArrowConfig arrow)
|
||||
{
|
||||
@@ -1467,7 +1628,7 @@ namespace ChillConnect
|
||||
temp.IsLevelSuccess = false;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(1);
|
||||
DOVirtual.DelayedCall(0.55f, () =>
|
||||
DOVirtual.DelayedCall(0.25f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
@@ -1575,7 +1736,7 @@ namespace ChillConnect
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(2);
|
||||
DOVirtual.DelayedCall(0.5f, () =>
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
@@ -1591,7 +1752,7 @@ namespace ChillConnect
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(2);
|
||||
DOVirtual.DelayedCall(0.5f, () =>
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
@@ -1677,11 +1838,13 @@ namespace ChillConnect
|
||||
public int arrowTrackIndex;
|
||||
public string finalMoveDir;
|
||||
|
||||
// ========== 新增:距离驱动移动所需字段 ==========
|
||||
// ========== 距离驱动移动所需字段 ==========
|
||||
public float movedDistance; // 当前整体累计移动距离
|
||||
public float trackTotalLength; // 整条轨迹的总像素长度
|
||||
public List<float> lineInitOffsets; // 每个线条单元的初始距离偏移
|
||||
public float arrowInitOffset; // 箭头的初始距离偏移
|
||||
// ========== 运行时颜色缓存 ==========
|
||||
public Color runtimeColor;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace ChillConnect
|
||||
SetBtnState();
|
||||
|
||||
ui.btn_dark.SetClick(() => { SetBtnClick(0); });
|
||||
ui.btn_worm.SetClick(() => { SetBtnClick(1); });
|
||||
// ui.btn_worm.SetClick(() => { SetBtnClick(1); });
|
||||
ui.btn_colours.SetClick(() => { SetBtnClick(2); });
|
||||
|
||||
|
||||
@@ -69,6 +69,9 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
ui.btn_switch.state.selectedIndex = DataMgr.ArrowDarkTheme.Value;
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.ThemeChange);
|
||||
|
||||
});
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
@@ -81,6 +84,8 @@ namespace ChillConnect
|
||||
{
|
||||
DataMgr.ArrowTheme.Value = index;
|
||||
SetBtnState();
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.ThemeChange);
|
||||
}
|
||||
|
||||
private void SetBtnState()
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43952a38995845739a7519afd4bb7d1c
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowTipsCtrl : BaseCtrl
|
||||
{
|
||||
public static ArrowTipsCtrl Instance { get; private set; }
|
||||
|
||||
private ArrowTipsModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d070658caacf42a79ba55d6ac90d78a6
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowTipsModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4051b0d4995a4a1399d64e95c6c582f1
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using FGUI.Arrow_game;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
|
||||
public class ArrowTipsUI : BaseUI
|
||||
{
|
||||
private ArrowTipsUICtrl ctrl;
|
||||
private ArrowTipsModel model;
|
||||
private com_tips ui;
|
||||
|
||||
public ArrowTipsUI(ArrowTipsUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ArrowTipsUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "Arrow_game";
|
||||
uiInfo.assetName = "com_tips";
|
||||
uiInfo.layerType = UILayerType.Loading;
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
CommonHelper.FadeOut(ui);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_tips;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
CommonHelper.FadeIn(ui);
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
ui.btn_watch.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("deletePop", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.SetDelete);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4737faa4124f48fabc5ef35ef2ff9f2f
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,60 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowTipsUICtrl : BaseUICtrl
|
||||
{
|
||||
private ArrowTipsUI ui;
|
||||
private ArrowTipsModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ArrowTipsUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ArrowTipsUI_Close;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ArrowTipsUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
|
||||
ui = null;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e1a6be77c1c462a86ed773072d923d3
|
||||
timeCreated: 1781677288
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using FGUI.GameResult_08;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -49,9 +50,27 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
ui.btn_revive.SetClick(() =>
|
||||
{
|
||||
float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
|
||||
var temp = new SuccessData();
|
||||
temp.IsWin = false;
|
||||
temp.cash_number = cash_array[0];
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(2);
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
ui.btn_restart.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, args);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
CtrlCloseUI();
|
||||
|
||||
});
|
||||
|
||||
@@ -323,7 +323,10 @@ namespace ChillConnect
|
||||
|
||||
DOVirtual.DelayedCall(0.7f, () =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
if (IsLevelSuccess)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
}
|
||||
|
||||
CtrlCloseUI();
|
||||
// if (IsLevelSuccess) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Open, true);
|
||||
|
||||
@@ -38,8 +38,7 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
|
||||
WebviewManager.Instance.setInH5View(false);
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -50,11 +49,11 @@ namespace ChillConnect
|
||||
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(() =>
|
||||
{
|
||||
|
||||
@@ -55,7 +55,6 @@ namespace ChillConnect
|
||||
|
||||
GameHelper.showGameUI = true;
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
gameDispatcher.Dispatch(GameMsg.MakeUpConfirmUIClosed);
|
||||
|
||||
@@ -88,7 +87,6 @@ namespace ChillConnect
|
||||
DataMgr.MakeupTaskH5Time.Value = 999999999;
|
||||
// DataMgr.Ticket.Value = 999999999; //zhushi
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
|
||||
makeupTaskData = args as MakeupTaskData;
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
CommonHelper.FadeOut(ui);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -67,7 +66,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
CommonHelper.FadeIn(ui);
|
||||
|
||||
// if (args != null)
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= upData;
|
||||
|
||||
@@ -58,7 +57,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
// ui.bg.y += 68;
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -64,13 +63,23 @@ namespace ChillConnect
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
_selectIndex = DataMgr.PlayerAvatarId.Value;
|
||||
|
||||
GetSliderValueByScale((float)args);
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
private void GetSliderValueByScale(float speed)
|
||||
{
|
||||
float validScale = Mathf.Clamp(speed, 1200f, 1700f);
|
||||
float ratio = (validScale - 1200f) / (1700f - 1200f);
|
||||
float sliderVal = ratio * 100f;
|
||||
|
||||
ui.speed_slide.value = Mathf.Clamp(sliderVal, 0f, 100f);
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
// CommonHelper.FadeIn(ui);
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
ui.show.Play();
|
||||
}
|
||||
|
||||
@@ -109,14 +118,24 @@ namespace ChillConnect
|
||||
|
||||
ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0); });
|
||||
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1); });
|
||||
ui.btn_official.SetClick(() => { OpenBrowser.OpenURL("http://captainsroll.com/"); });
|
||||
ui.btn_official.SetClick(() => { Application.OpenURL("http://captainsroll.com/"); });
|
||||
|
||||
ui.btn_us.SetClick(() => { GameHelper.OpenEmail(); });
|
||||
|
||||
ui.btn_revive.SetClick(() =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
ui.level_text.SetVar("lv",GameHelper.GetLevel().ToString()).FlushVars();
|
||||
|
||||
ui.speed_slide.onChanged.Add(SetSlideValue);
|
||||
|
||||
ui.btn_music.on_off.selectedIndex =
|
||||
model.IsOpenMusic ? btn_music_on_off.On_off_off : btn_music_on_off.On_off_on;
|
||||
model.IsOpenMusic ? 0 : 1;
|
||||
ui.btn_sound.on_off.selectedIndex =
|
||||
GRoot.inst.soundVolume > 0 ? btn_music_on_off.On_off_off : btn_music_on_off.On_off_on;
|
||||
GRoot.inst.soundVolume > 0 ? 0 : 1;
|
||||
|
||||
ui.btn_music.SetClick(SetMusic);
|
||||
ui.btn_sound.SetClick(SetSound);
|
||||
@@ -155,6 +174,22 @@ namespace ChillConnect
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void SetSlideValue()
|
||||
{
|
||||
var sliderValue = (float)ui.speed_slide.value;
|
||||
// 先把滑块值钳位在 0~100 内
|
||||
float val = Mathf.Clamp(sliderValue, 0f, 100f);
|
||||
|
||||
// 线性映射:0→0.6,100→1.5
|
||||
float ratio = val / 100f;
|
||||
float speed = 1200f + ratio * (1700f - 1200f);
|
||||
|
||||
|
||||
speed = Mathf.Clamp(speed, 1200f, 1700f);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UpdateSpeed, speed);
|
||||
}
|
||||
|
||||
|
||||
private void UpdateItem(int index, GObject items)
|
||||
{
|
||||
@@ -191,8 +226,8 @@ namespace ChillConnect
|
||||
model.IsOpenMusic = !model.IsOpenMusic;
|
||||
|
||||
ui.btn_music.on_off.selectedIndex = model.IsOpenMusic
|
||||
? btn_music_on_off.On_off_off
|
||||
: btn_music_on_off.On_off_on;
|
||||
? 0
|
||||
: 1;
|
||||
|
||||
|
||||
}
|
||||
@@ -205,8 +240,8 @@ namespace ChillConnect
|
||||
GRoot.inst.soundVolume = sound;
|
||||
PlayerPrefs.SetFloat("soundVolume", sound);
|
||||
ui.btn_sound.on_off.selectedIndex = sound > 0
|
||||
? btn_music_on_off.On_off_off
|
||||
: btn_music_on_off.On_off_on;
|
||||
? 0
|
||||
: 1;
|
||||
}
|
||||
private void SetVersion()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using AppsFlyerSDK;
|
||||
// using AppsFlyerSDK;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -230,17 +230,17 @@ namespace ChillConnect
|
||||
|
||||
if (!GameHelper.IsAdModelOfPay() && !string.IsNullOrEmpty(purch_number) && decimal.TryParse(purch_number, out decimal revenue))
|
||||
{
|
||||
Debug.Log("付费收益上报AF----------- " + revenue);
|
||||
adCallbackInfo.Clear();
|
||||
adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
||||
adCallbackInfo.Add("customer_user_id", GameHelper.GetLoginModel().Uid.ToString());
|
||||
adCallbackInfo.Add("af_currency", "USD");
|
||||
adCallbackInfo.Add("af_revenue", revenue.ToString(CultureInfo.InvariantCulture));
|
||||
AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
|
||||
|
||||
GameHelper.SendRevenueToServer(Property.Af_purchase, "af_revenue", (int)(revenue * 10000));
|
||||
|
||||
RankSystemMgr.Instance.addGameExp(addPointType.buy, revenue);
|
||||
// Debug.Log("付费收益上报AF----------- " + revenue);
|
||||
// adCallbackInfo.Clear();
|
||||
// adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
||||
// adCallbackInfo.Add("customer_user_id", GameHelper.GetLoginModel().Uid.ToString());
|
||||
// adCallbackInfo.Add("af_currency", "USD");
|
||||
// adCallbackInfo.Add("af_revenue", revenue.ToString(CultureInfo.InvariantCulture));
|
||||
// AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
|
||||
//
|
||||
// GameHelper.SendRevenueToServer(Property.Af_purchase, "af_revenue", (int)(revenue * 10000));
|
||||
//
|
||||
// RankSystemMgr.Instance.addGameExp(addPointType.buy, revenue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
HallManager.Instance.UpdateSecondEvent -= upTime;
|
||||
|
||||
RankSystemMgr.Instance.upRewardAndRank();
|
||||
@@ -72,7 +71,6 @@ namespace ChillConnect
|
||||
{
|
||||
ui.group_top.y += 68;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
TrackKit.SendEvent(Property.rank_Event,Property.RankShow);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += upTime;
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
AdRedeemManager.Instance.Destroy();
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -61,7 +60,6 @@ namespace ChillConnect
|
||||
{
|
||||
ui.group_top.y += 68;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
rewardList = SaveData.GetRankData().rankRewardData;
|
||||
InitView();
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ namespace ChillConnect
|
||||
HallManager.Instance.UpdateSecondEvent -= Update;
|
||||
closeCallback?.Invoke();
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshSaveingPot);
|
||||
|
||||
@@ -78,7 +77,6 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuygoldUI_Close);
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
AdRedeemManager.Instance.Destroy();
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= initList;
|
||||
HallManager.Instance.UpdateSecondEvent -= upWatchAdsBtn;
|
||||
@@ -78,7 +77,6 @@ namespace ChillConnect
|
||||
{
|
||||
isAutoPop = (bool)args;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
// test
|
||||
// SaveData.GetSaveObject().remove_ad_time = Convert.ToInt32(GameHelper.GetNowTime()) + 5;
|
||||
// SaveData.GetSaveObject().is_get_removead = true;
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -69,7 +68,6 @@ namespace ChillConnect
|
||||
}
|
||||
CommonHelper.CheckAdTimes();
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
|
||||
if (GameHelper.GetGameday() != DateTime.Now.Day)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
public class OpenBrowser
|
||||
{
|
||||
[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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6674c4f11b4b5475797b28ab812007dd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using AppsFlyerSDK;
|
||||
// using AppsFlyerSDK;
|
||||
using DG.Tweening;
|
||||
using IgnoreOPS;
|
||||
using RgfCDfHLhn9WSDK;
|
||||
using SGModule.Net;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
@@ -35,52 +34,52 @@ namespace ChillConnect
|
||||
public static void Init()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
// 注册 ab事件,0或1,0为自然量版本,1为激励版本
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.RegistIosParam(i =>
|
||||
{
|
||||
SuperApplication.Instance.attribution = i == 0 ? "organic" : "non_organic";
|
||||
Debug.Log($"ios ab param : {i} attribution=== {SuperApplication.Instance.attribution}");
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
|
||||
});
|
||||
|
||||
void GameConfig(bool result, string config)
|
||||
{
|
||||
Debug.Log($"************* game config result : {result}, config : {config}");
|
||||
}
|
||||
// SDK初始化方法
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.Init(null, null, GameConfig);
|
||||
// // 注册 ab事件,0或1,0为自然量版本,1为激励版本
|
||||
// RgfCDfHLhn9WSDK_Utility.Instance.RegistIosParam(i =>
|
||||
// {
|
||||
// SuperApplication.Instance.attribution = i == 0 ? "organic" : "non_organic";
|
||||
// Debug.Log($"ios ab param : {i} attribution=== {SuperApplication.Instance.attribution}");
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
//
|
||||
// });
|
||||
//
|
||||
// void GameConfig(bool result, string config)
|
||||
// {
|
||||
// Debug.Log($"************* game config result : {result}, config : {config}");
|
||||
// }
|
||||
// // SDK初始化方法
|
||||
// RgfCDfHLhn9WSDK_Utility.Instance.Init(null, null, GameConfig);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public static bool CheckInterstitialReady()
|
||||
{
|
||||
return RgfCDfHLhn9WSDK_Utility.Instance.IsInterReady();
|
||||
}
|
||||
// public static bool CheckInterstitialReady()
|
||||
// {
|
||||
// return RgfCDfHLhn9WSDK_Utility.Instance.IsInterReady();
|
||||
// }
|
||||
#region 插屏广告相关
|
||||
public static UnityAction<bool> onInterstitialAdCompleted;
|
||||
|
||||
public static void ShowInterstitial(string placement = "DefaultInterstitial",
|
||||
UnityAction<bool> onCompleted = null)
|
||||
{
|
||||
if (CheckInterstitialReady())
|
||||
{
|
||||
Debug.Log($"广告已经准备好,播放");
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.ShowInter(placement, () =>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
onCompleted?.Invoke(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"广告未准备好,不播放");
|
||||
onCompleted?.Invoke(false);
|
||||
}
|
||||
// if (CheckInterstitialReady())
|
||||
// {
|
||||
// Debug.Log($"广告已经准备好,播放");
|
||||
// // RgfCDfHLhn9WSDK_Utility.Instance.ShowInter(placement, () =>
|
||||
// // {
|
||||
// // DOVirtual.DelayedCall(0.1f, () =>
|
||||
// // {
|
||||
onCompleted?.Invoke(true);
|
||||
// // });
|
||||
// // });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Debug.Log($"广告未准备好,不播放");
|
||||
// onCompleted?.Invoke(false);
|
||||
// }
|
||||
}
|
||||
|
||||
static int retryAttemptInterstitial;
|
||||
@@ -125,47 +124,47 @@ namespace ChillConnect
|
||||
|
||||
public static UnityAction<bool> onVideoAdCompleted;
|
||||
private static string _placement = "";
|
||||
public static bool CheckRewardedReady()
|
||||
{
|
||||
return RgfCDfHLhn9WSDK_Utility.Instance.IsVideoReady();
|
||||
}
|
||||
// public static bool CheckRewardedReady()
|
||||
// {
|
||||
// return RgfCDfHLhn9WSDK_Utility.Instance.IsVideoReady();
|
||||
// }
|
||||
public static void ShowVideo(string placement = "DefaultVideo", UnityAction<bool> onCompleted = null)
|
||||
{
|
||||
onVideoAdCompleted = onCompleted;
|
||||
_placement = placement;
|
||||
#if UNITY_EDITOR
|
||||
onVideoAdCompleted?.Invoke(true);
|
||||
#else
|
||||
// #if UNITY_EDITOR
|
||||
onVideoAdCompleted?.Invoke(true);
|
||||
// #else
|
||||
TrackKit.SendEvent(Property.adEvent,Property.watch_ad_people);
|
||||
TrackKit.SendEvent(Property.adEvent,Property.Rewarded_videos_trigger_number);
|
||||
|
||||
if (CheckRewardedReady())
|
||||
{
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.ShowRewardVideo(_placement, b =>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
onVideoAdCompleted?.Invoke(b);
|
||||
});
|
||||
}, ()=>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.25f, () =>
|
||||
{
|
||||
Debug.Log($"激励广告关闭");
|
||||
if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().is_get_removead && (UnityEngine.Random.Range(0, 100) < GameHelper.GetCommonModel().rewardinsertion))
|
||||
{
|
||||
TrackKit.SendEvent(Property.adEvent, Property.AfterRewardAdShow);
|
||||
|
||||
GameHelper.ShowInterstitial("AfterReward");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
onVideoAdCompleted?.Invoke(false);
|
||||
}
|
||||
#endif
|
||||
// if (CheckRewardedReady())
|
||||
// {
|
||||
// RgfCDfHLhn9WSDK_Utility.Instance.ShowRewardVideo(_placement, b =>
|
||||
// {
|
||||
// DOVirtual.DelayedCall(0.1f, () =>
|
||||
// {
|
||||
// onVideoAdCompleted?.Invoke(b);
|
||||
// });
|
||||
// }, ()=>
|
||||
// {
|
||||
// DOVirtual.DelayedCall(0.25f, () =>
|
||||
// {
|
||||
// Debug.Log($"激励广告关闭");
|
||||
// if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().is_get_removead && (UnityEngine.Random.Range(0, 100) < GameHelper.GetCommonModel().rewardinsertion))
|
||||
// {
|
||||
// TrackKit.SendEvent(Property.adEvent, Property.AfterRewardAdShow);
|
||||
//
|
||||
// GameHelper.ShowInterstitial("AfterReward");
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// onVideoAdCompleted?.Invoke(false);
|
||||
// }
|
||||
// #endif
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1,839 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ChillConnect;
|
||||
using FairyGUI;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using DG.Tweening;
|
||||
using IgnoreOPS;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace IgnoreOPS
|
||||
{
|
||||
|
||||
|
||||
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.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" };
|
||||
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_number, 1);
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.fly_ct_people,1);
|
||||
TrackKit.SendEvent(Property.Event, Property.FlyCtNumber);
|
||||
|
||||
}
|
||||
|
||||
if (name == "rewardBtn")
|
||||
{
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_ct_number, 1);
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.annular_ct_people,1);
|
||||
TrackKit.SendEvent(Property.Event, Property.AnnularCtNumber);
|
||||
|
||||
}
|
||||
|
||||
if (name == "finish")
|
||||
{
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_finish_number, 1);
|
||||
TrackKit.SendEvent(Property.Event, Property.AnnularFinishNumber);
|
||||
|
||||
}
|
||||
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.GetConfig<CommonModel>().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.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);
|
||||
|
||||
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 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 (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i] - SaveData.GetSaveObject().dark_Dayref[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 += "|";
|
||||
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++)
|
||||
// {
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// 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].WVOffset ;
|
||||
}
|
||||
|
||||
|
||||
string darkWVRefreshtime_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;
|
||||
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("--------------------------------");
|
||||
|
||||
// add_time+= ConfigSystem.GetConfig<CommonModel>().WVClickAddTime[0] + "|" + ConfigSystem.GetConfig<CommonModel>().WVClickAddTime[1];
|
||||
|
||||
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("|");
|
||||
if (temp_array.Length >= 2 && temp_array[0] != null && temp_array[0] != "")
|
||||
{
|
||||
H5sendClass info = new H5sendClass() { link = temp_array[0], type = temp_array[1] };
|
||||
NetApi.SetClickAdEvent<object>(temp_array[0], temp_array[1], (isSuccess, obj) =>
|
||||
{
|
||||
// if (isSuccess)
|
||||
// {
|
||||
// Debug.Log("dadianchenggong" + temp_array[0]);
|
||||
// }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public static bool haveSimCard = false;
|
||||
public void diaoyongtest(string have)
|
||||
{
|
||||
if (have == "TRUE") haveSimCard = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class H5refreshTimes
|
||||
{
|
||||
public string link;
|
||||
public int times;
|
||||
|
||||
}
|
||||
public class H5sendClass
|
||||
{
|
||||
public string link;
|
||||
public string type;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f3b9d6c409a4d71bcc6f0c3720f826d
|
||||
timeCreated: 1780739859
|
||||
Reference in New Issue
Block a user