From 2128ef4695076d78f66eaf12ee11bb0f92270adf Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 25 三月 2026 20:16:53 +0800
Subject: [PATCH] 0312 趣动SDK相关接口
---
Main/System/SmallFunc/SmallFuncManager.cs | 27 ++++++--
Main/System/SmallFunc/GoodReviewWin.cs | 12 +++
Main/SDK/SDKUtils.cs | 82 +++++++++++++++++++++-----
3 files changed, 95 insertions(+), 26 deletions(-)
diff --git a/Main/SDK/SDKUtils.cs b/Main/SDK/SDKUtils.cs
index e4572f2..8a5d865 100644
--- a/Main/SDK/SDKUtils.cs
+++ b/Main/SDK/SDKUtils.cs
@@ -22,6 +22,7 @@
Quick = 10, //quick
Hy = 15, //娆㈡父
Gaore = 20, // 20-楂樼儹 - 纭牳娓犻亾
+ Qudong = 21, //21-瓒e姩 - 娴峰娓犻亾
}
//鏉冮檺鐢宠鍥炶皟
@@ -367,6 +368,13 @@
SendMessageToSDK(m_Json);
}
+ //璇勫垎
+ public void GoToReview()
+ {
+ m_Json.Clear();
+ m_Json["code"] = CodeU2A.GoToReview;
+ SendMessageToSDK(m_Json);
+ }
#endregion
#region 澶勭悊涓嶴DK浜や簰鐨勫簳灞傛柟娉�
@@ -400,12 +408,21 @@
private void SendMessageToSDK(JsonData json)
{
-
#if !UNITY_EDITOR
#if UNITY_ANDROID
- using (AndroidJavaClass H2engineSDK = new AndroidJavaClass("com.wgyx.sdk.UnityMsgHandler"))
+ if (VersionConfig.Get().appID == "sghy")
{
- H2engineSDK.CallStatic("onUnityMessage", json.ToJson());
+ using (AndroidJavaClass H2engineSDK = new AndroidJavaClass("com.xssg.sdk.UnityMsgHandler"))
+ {
+ H2engineSDK.CallStatic("onUnityMessage", json.ToJson());
+ }
+ }
+ else
+ {
+ using (AndroidJavaClass H2engineSDK = new AndroidJavaClass("com.wgyx.sdk.UnityMsgHandler"))
+ {
+ H2engineSDK.CallStatic("onUnityMessage", json.ToJson());
+ }
}
#elif UNITY_IOS
AotSdkUtility.IOSUniyMessageHandle(json.ToJson());
@@ -489,7 +506,11 @@
{
ChannelPlatform = E_ChannelPlatform.Gaore;
}
-
+ else if (_channelPlatform.Equals("sghy"))
+ {
+ ChannelPlatform = E_ChannelPlatform.Qudong;
+ }
+
}
}
@@ -793,11 +814,11 @@
public const int DownloadStart = 110;
public const int DownloadEnd = 111;
public const int ShareToFaceBook = 112;
- public const int GoToPingfen = 113; //鍓嶅線璇勫垎 鍜� GotoShop = 121; 鏈夊尯鍒�
+ public const int GoToReview = 113; //鍓嶅線璇勫垎 鍜� GotoShop = 121; 鏈夊尯鍒�
public const int ShowAccountView = 114;
public const int RoleLoginOut = 119; //瑙掕壊鐧诲嚭
- public const int FansHouse = 120; //绮変笣灞� 璁哄潧绛�
- public const int GotoShop = 121; //鍓嶅線鍟嗗簵
+ // public const int FansHouse = 120; //绮変笣灞� 璁哄潧绛�
+ // public const int GotoShop = 121; //鍓嶅線鍟嗗簵
public const int TrackEvent = 122; //鑷畾涔変簨浠�
public const int PlayAds = 123; //鎾斁骞垮憡
/**
@@ -923,7 +944,7 @@
-
+
/// <summary>
/// 鑷敱SDK鏀粯 fixed sdk 鏀粯閫昏緫淇敼
@@ -1001,11 +1022,11 @@
}
}
}
-//#if !(UNITY_IOS || UNITY_IPHONE)
-// string storeOrderInfo = orderInfo.StoreOrderInfo;
-//#else
-// string storeOrderInfo = orderInfo.StoreOrderInfo2;
-//#endif
+ #if !(UNITY_IOS || UNITY_IPHONE)
+ string storeOrderInfo = orderInfo.StoreOrderInfo;
+ #else
+ string storeOrderInfo = orderInfo.StoreOrderInfo2;
+ #endif
#if UNITY_EDITOR
Debug.LogFormat("鍏呭��: {0}-{1}-{2}", title, money, cpInfo);
@@ -1017,7 +1038,7 @@
m_Json["orderId"] = DateTime.Now.ToString("yyyyMMddHHmmss") + UnityEngine.Random.Range(100000, 999999).ToString();
m_Json["mount"] = money.ToString();
m_Json["cpInfo"] = cpInfo;
- //m_Json["storeOrderInfo"] = storeOrderInfo;
+ m_Json["storeOrderInfo"] = storeOrderInfo;
m_Json["title"] = title;
m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID;
m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName;
@@ -1191,6 +1212,23 @@
}
+ //浜嬩欢鍚嶇О 鐢辫繍钀ユ彁渚�
+ //蹇呬紶鐨�2涓簨浠讹紝
+ // "tutorial_complete" 瀹屾垚鏂版墜寮曞銆�
+ // "AchieveLevel_40" 鍒拌揪40绾�
+ void SendOverSeaTraceEvent(string eventName, string value = "")
+ {
+ //娴峰瓒e姩鐗堟湰锛屽鏈夊叾浠栨捣澶栦笉鍚岄渶鍖哄垎
+ m_Json.Clear();
+ m_Json["code"] = CodeU2A.TrackEvent;
+ m_Json["eventName"] = eventName;
+ m_Json["value"] = value;
+
+ SendMessageToSDK(m_Json);
+ }
+
+
+ //楂樼儹鐗堟湰
void SendGaoreEvent(int dataType, string pageType = "鏃�", string pageName = "鏃�", string pageItemId = "鏃�",
int money = 0, string orderID = "")
{
@@ -1252,19 +1290,29 @@
public void SendTraceEvent(int dataType, string pageType = "鏃�", string pageName = "鏃�", string pageItemId = "鏃�",
int money = 0, string orderID = "")
{
+ var appID = VersionConfig.Get().appId;
if (VersionConfig.Get().appId == "ryzj")
{
SendGaoreEvent(dataType, pageType, pageName, pageItemId, money, orderID);
return;
}
+ else if (appID == "sghy")
+ {
+ SendOverSeaTraceEvent("tutorial_complete");
+ }
}
public void RoleLevelUp()
{
- if (VersionConfig.Get().appId == "ryzj")
+ var appID = VersionConfig.Get().appId;
+ if (appID == "ryzj")
{
SendGaoreEvent(4);
return;
+ }
+ else if (appID == "sghy" && PlayerDatas.Instance.baseData.LV == 40)
+ {
+ SendOverSeaTraceEvent("AchieveLevel_40");
}
@@ -1333,8 +1381,8 @@
{
m_Json.Clear();
m_Json["code"] = CodeU2A.PlayAds;
- m_Json["adid"] = adid;
- m_Json["type"] = 0;
+ m_Json["adid"] = adid;
+ m_Json["type"] = 0;
SendMessageToSDK(m_Json);
}
diff --git a/Main/System/SmallFunc/GoodReviewWin.cs b/Main/System/SmallFunc/GoodReviewWin.cs
index 459024f..f2b9205 100644
--- a/Main/System/SmallFunc/GoodReviewWin.cs
+++ b/Main/System/SmallFunc/GoodReviewWin.cs
@@ -28,8 +28,16 @@
if (!string.IsNullOrEmpty(SDKUtils.channelSign))
{
- //鍓嶅線璇勪环
- Application.OpenURL(GeneralDefine.review_UrlDict[SDKUtils.channelSign]);
+ var appID = VersionConfig.Get().appId;
+ if (appID == "sghy")
+ {
+ SDKUtils.Instance.GoToReview();
+ }
+ else
+ {
+ //鍓嶅線璇勪环
+ Application.OpenURL(GeneralDefine.review_UrlDict[SDKUtils.channelSign]);
+ }
}
LocalSave.SetInt("review" + PlayerDatas.Instance.baseData.PlayerID, TimeUtility.AllSeconds);
}
diff --git a/Main/System/SmallFunc/SmallFuncManager.cs b/Main/System/SmallFunc/SmallFuncManager.cs
index 96000bc..c166d16 100644
--- a/Main/System/SmallFunc/SmallFuncManager.cs
+++ b/Main/System/SmallFunc/SmallFuncManager.cs
@@ -63,16 +63,29 @@
//鏄惁鏄剧ず濂借瘎 1.杈惧埌閫氬叧鏉′欢 2.璇ユ笭閬撴湁濂借瘎鍔熻兘锛�3. 鏈鍙栧鍔憋紙鏈瘎浠凤級
public bool IsReviewOpen()
- {
- if (PlayerDatas.Instance.baseData.ExAttr1 / 100 <= GeneralDefine.review_MainLevel)
+ {
+ var appID = VersionConfig.Get().appId;
+ if (appID == "sghy")
{
- return false;
+ if (TimeUtility.CreateDays == 1)
+ {
+ //绗簩澶╂墠鍙互璇勮
+ return false;
+ }
+ }
+ else
+ {
+ if (PlayerDatas.Instance.baseData.ExAttr1 / 100 <= GeneralDefine.review_MainLevel)
+ {
+ return false;
+ }
+
+ if (!GeneralDefine.review_UrlDict.ContainsKey(SDKUtils.channelSign) && VersionConfig.Get().versionAuthority == VersionAuthority.Release)
+ {
+ return false;
+ }
}
- if (!GeneralDefine.review_UrlDict.ContainsKey(SDKUtils.channelSign) && VersionConfig.Get().versionAuthority == VersionAuthority.Release)
- {
- return false;
- }
if (GetReviewState() == 2)
{
--
Gitblit v1.8.0