bilisdk登录优化
parent
fd2b19e459
commit
bc3452ca3e
|
|
@ -14,12 +14,6 @@ namespace Gameplay.Net
|
|||
|
||||
public override void Start()
|
||||
{
|
||||
SdkHelper sdkHelper = SDKManager.Instance.GetSdkHelper(SDKManager.SdkName.Bilibili);
|
||||
#if SDK_BILIBILI
|
||||
BilibiliSdkHelper biliSdkHelper = sdkHelper as BilibiliSdkHelper;
|
||||
|
||||
biliSdkHelper.BiliListerner.RegistLoginCallback(LoginSuccess);
|
||||
#endif
|
||||
}
|
||||
|
||||
public override void End()
|
||||
|
|
@ -40,10 +34,6 @@ namespace Gameplay.Net
|
|||
SdkHelper sdkHelper = SDKManager.Instance.GetSdkHelper(SDKManager.SdkName.Bilibili);
|
||||
ILoginService loginService = sdkHelper as ILoginService;
|
||||
loginService?.Login(LoginSuccess, OnLoginFail);
|
||||
#if SDK_BILIBILI
|
||||
GSCSdkInterface.login();
|
||||
DebugUtil.Log("调用哔哩哔哩登录");
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Logout()
|
||||
|
|
@ -69,16 +59,5 @@ namespace Gameplay.Net
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
private void LoginSuccess(string accesstoken, string uid)
|
||||
{
|
||||
#if SDK_BILIBILI
|
||||
DebugUtil.Log("登录成功");
|
||||
SdkHelper sdkHelper = SDKManager.Instance.GetSdkHelper(SDKManager.SdkName.Bilibili);
|
||||
ILoginService loginService = sdkHelper as ILoginService;
|
||||
if (loginService is BilibiliSdkHelper loginHelper)
|
||||
loginHelper.LoginSuccess(accesstoken, uid);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -734,9 +734,9 @@ public class UI_StartGameInterfaceController : UIWindow
|
|||
/// </summary>
|
||||
private void OnBilibiliClick()
|
||||
{
|
||||
DebugUtil.Log("点击哔哩哔哩登录");
|
||||
#if SDK_BILIBILI
|
||||
DebugUtil.Log("点击哔哩哔哩登录2");
|
||||
DebugUtil.Log("点击哔哩哔哩登录");
|
||||
GSCSdkInterface.logout();
|
||||
Actor.Instance.StartLogin(NLDPB.LoginType.BiliBili, "");
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit fad35e004a6203d89fb319aa322f65f6dcc0a475
|
||||
Subproject commit f33864edcd5df9efdbceca3208ef07a84a998150
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
using PhxhSDK;
|
||||
#if SDK_BILIBILI
|
||||
using PhxhSDK.AOT.Bilibili;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PhxhSDK
|
||||
{
|
||||
|
|
@ -32,6 +30,11 @@ namespace PhxhSDK
|
|||
public void Login(Action onLoginSuccess, Action<int, string> onLoginFail)
|
||||
{
|
||||
loginSuccess = onLoginSuccess;
|
||||
|
||||
SdkHelper sdkHelper = SDKManager.Instance.GetSdkHelper(SDKManager.SdkName.Bilibili);
|
||||
BilibiliSdkHelper biliSdkHelper = sdkHelper as BilibiliSdkHelper;
|
||||
biliSdkHelper.BiliListerner.RegistLoginCallback(LoginSuccess);
|
||||
GSCSdkInterface.login();
|
||||
}
|
||||
|
||||
public void Logout()
|
||||
|
|
@ -53,4 +56,5 @@ namespace PhxhSDK
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#if SDK_BILIBILI
|
||||
using PhxhSDK;
|
||||
using UnityEngine;
|
||||
using PhxhSDK.AOT.Bilibili;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue