update:更新接口的修改

This commit is contained in:
2026-06-05 16:57:07 +08:00
parent 4d3eae1c88
commit ea03c8023f
7 changed files with 566 additions and 193 deletions

View File

@@ -106,6 +106,9 @@ namespace tysdk
private static TYSdkFacade _instance;
public static bool IsSdkInited { get; private set; }
public static bool IsInitStarted { get; private set; }
public static bool HasInitResult { get; private set; }
public static string LastInitMessage { get; private set; }
public static event System.Action<bool, string> OnInitComplete;
public static TYSdkFacade Instance
@@ -122,7 +125,10 @@ namespace tysdk
}
public void Init()
{
Debug.Log($"[TYSdkFacade] Init()");
Debug.Log("[FLX-INIT] TYSdkFacade Init");
IsInitStarted = true;
HasInitResult = false;
LastInitMessage = string.Empty;
#if UNITY_ANDROID
UnityBridgeFunc.InitSDK(ChannelConfig.Channel);
#endif
@@ -131,13 +137,13 @@ namespace tysdk
public void SetChannelFromNative(string channel)
{
Debug.Log($"[TYSdkFacade] SetChannelFromNative: {channel}");
// Debug.Log($"[TYSdkFacade] SetChannelFromNative: {channel}");
ChannelConfig.SetChannel(channel);
}
public void InitResult(string json)
{
Debug.Log($"[TYSdkFacade] InitResult: {json}");
Debug.Log($"[FLX-INIT] TYSdkFacade InitResult: {json}");
var success = false;
var msg = string.Empty;
@@ -154,6 +160,8 @@ namespace tysdk
}
IsSdkInited = success;
HasInitResult = true;
LastInitMessage = msg;
OnInitComplete?.Invoke(success, msg);
}
@@ -173,7 +181,7 @@ namespace tysdk
public void Logout()
{
UnityEngine.Debug.Log("Logout");
// UnityEngine.Debug.Log("Logout");
if (_accountInfo != null)
{
UnityBridgeFunc.UnityLogOutByChannel(_accountInfo.channel);
@@ -253,7 +261,7 @@ namespace tysdk
public async Task<LoginInfo> LoginBySns()
{
Debug.Log("[TYSdkFacade] LoginBySns");
// Debug.Log("[TYSdkFacade] LoginBySns");
var task = TYSDKCallbackManager.Instance.RegisterCallback<LoginInfo>(TimeSpan.FromSeconds(30));
@@ -286,7 +294,7 @@ namespace tysdk
public void LoginResult(string json)
{
Debug.Log("[TYSdkFacade] Login callback:");
// Debug.Log("[TYSdkFacade] Login callback:");
var result = new LoginInfo();
var data = JObject.Parse(json);
var code = (int)data["code"];
@@ -553,7 +561,7 @@ namespace tysdk
//对sign进行MD5加密
string signMd5 = CalculateMD5Hash(sign);
string url = $"{tycs}?{listStr}&sign={signMd5}&isAbroad=1&lan=en";
Debug.Log($"[TYSdkFacade:Signout] url \n{url}");
// Debug.Log($"[TYSdkFacade:Signout] url \n{url}");
Application.OpenURL(url);
}