Skip to content

Commit 3734340

Browse files
committed
feat(微信登录): 在编辑器环境下模拟微信登录成功
在Unity编辑器环境下直接模拟微信登录成功回调,方便开发测试
1 parent 238da92 commit 3734340

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Runtime/WeChatLoginManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public void Login(Action<WeChatLoginSuccess> loginSuccess, Action<int> loginFail
9191
{
9292
_loginSuccess = loginSuccess;
9393
_loginFail = loginFail;
94+
#if UNITY_EDITOR
95+
_loginSuccess?.Invoke(new WeChatLoginSuccess() { NickName = "test", OpenId = SystemInfo.deviceUniqueIdentifier, PhotoUrl = "test", UnionId = SystemInfo.deviceUniqueIdentifier });
96+
return;
97+
#endif
9498
_shareSDK.Authorize(PlatformType.WeChat);
9599
}
96100

0 commit comments

Comments
 (0)