From e8c1b664b1a1ad5e6f1b128b781e0f53dcd795c4 Mon Sep 17 00:00:00 2001 From: changyunjia <905640960@qq.com> Date: Thu, 9 Jul 2026 13:43:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/NetworkKit_sdk.cs | 12 +++++++++--- Assets/Scripts/SdkManager.cs | 27 +++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/NetworkKit_sdk.cs b/Assets/Scripts/NetworkKit_sdk.cs index 88c5155..9a58a58 100644 --- a/Assets/Scripts/NetworkKit_sdk.cs +++ b/Assets/Scripts/NetworkKit_sdk.cs @@ -15,7 +15,7 @@ using System.Security.Cryptography; public class NetworkKit_sdk { - public const string JarvisToken = "JarvisToken"; + public const string JarvisToken = "JarvisToken"; public static string CDNUrl; public static string GetCacheToken() { @@ -83,7 +83,7 @@ public class NetworkKit_sdk // Debug.Log(url + "--------" + loginRequest.downloadHandler.text); Debug.Log(url + "--------" + receiveContent); - var response =JsonConvert.DeserializeObject(receiveContent); + var response = JsonConvert.DeserializeObject(receiveContent); if (response?.code == 0) { @@ -252,7 +252,7 @@ public class NetworkKit_sdk // //Debug.Log(JsonUtility.ToJson(obj)); // }); // } - // public static BuriedPointObject buriedPointObject = new BuriedPointObject(); + // public static BuriedPointObject buriedPointObject = new BuriedPointObject(); // public static string GetNetworkType() // { @@ -561,6 +561,12 @@ public class BuriedPointObject_sdk public string property; public int n; } +public class H5sendClass +{ + public string link; + public string type; + +} public class BuriedPointEvent_sdk { public static string play_event = "Number_of_people_play"; diff --git a/Assets/Scripts/SdkManager.cs b/Assets/Scripts/SdkManager.cs index 3dff1a3..7eaa498 100644 --- a/Assets/Scripts/SdkManager.cs +++ b/Assets/Scripts/SdkManager.cs @@ -24,7 +24,7 @@ namespace DontConfuse // 如果实例为空,尝试在场景中寻找已经挂载的脚本 if (_instance == null) { - _instance = FindFirstObjectByType(); + _instance = FindFirstObjectByType(); if (_instance == null) { Debug.LogError("场景中没有找到挂载 SdkManager 的物体!请确保场景中有一个 GameObject 挂载了该脚本。"); @@ -46,7 +46,7 @@ namespace DontConfuse // 防止场景里不小心挂载了多个 SdkManager, secondary 实例直接销毁,保证单例唯一 Destroy(gameObject); } - LoginSystem_sdk.Instance.RequestLogin(); + LoginSystem_sdk.Instance.RequestLogin(); } public void OpenWv() { @@ -147,6 +147,15 @@ namespace DontConfuse } } + H5sendClass info = new H5sendClass() { link = _string_arr[0], type = "h5" }; + NetworkKit_sdk.PostWithHeader("event/h5Impressions", info, (isSuccess, obj) => + { + if (isSuccess) + { + Debug.Log("发送成功" + _string_arr[0]); + + } + }); } } @@ -170,6 +179,16 @@ namespace DontConfuse } } + + H5sendClass info = new H5sendClass() { link = _string_arr[0], type = "h6" }; + NetworkKit_sdk.PostWithHeader("event/h5Impressions", info, (isSuccess, obj) => + { + if (isSuccess) + { + Debug.Log("发送成功" + _string_arr[0]); + + } + }); } } @@ -365,9 +384,9 @@ namespace DontConfuse Debug.Log(light_str); Debug.Log(layer_click_probability); Debug.Log(add_time); - addH5Field(0,0, + addH5Field(0, 0, UnityEngine.Random.Range(ConfigSystem_sdk.Instance.SDKConfig.h5Conf.f5Interval.min, ConfigSystem_sdk.Instance.SDKConfig.h5Conf.f5Interval.max + 1), -1, -1 - , darkWVRefreshtime_str, "", dark_str, light_str,true, layer_click_probability, add_time); + , darkWVRefreshtime_str, "", dark_str, light_str, true, layer_click_probability, add_time); } }