试了各种方法, UserInfoButton创建出来就是不显示,必须在屏幕上点击一下才出来,快来帮我看看吧,是啥原因?
//查看微信授权
GetSettingOption gsoinfo = new GetSettingOption();
gsoinfo.complete = (bb) =>
{
print("wx GetSetting complete!");/*查看微信授权完成*/
};
gsoinfo.success = (bb) =>
{
print("wx GetSetting success!");/*查看微信授权成功*/
if (bb.authSetting.ContainsKey("scope.userInfo") && bb.authSetting["scope.userInfo"])
{
//获得用户信息
GetUserInfoOption uio = new GetUserInfoOption();
uio.complete = (cc) =>
{
print("wx getuserinfo complete!");/*获取用户信息完成处理,成功失败都会调*/
};
uio.fail = (cc) =>
{
print("wx getuserinfo fail! errMsg:" + cc.errMsg);/*登录失败处理*/
};
uio.success = (cc) =>
{
print("wx getuserinfo sueecss");
};
WX.GetUserInfo(uio);
}
else
{
RequirePrivacyAuthorizeOption rpao = new RequirePrivacyAuthorizeOption();
rpao.fail = (dd) =>
{
print("wx RequirePrivacyAuthorize failed!");/*隐私授权失败*/
};
rpao.success = (dd) =>
{
print("wx RequirePrivacyAuthorize success!");/*隐私授权成功*/
//调用请求获取用户信息
WXUserInfoButton btn = WX.CreateUserInfoButton(0, 0, Screen.width, Screen.height, "zh_CN", true);
btn.Show();
btn.OnTap((res) =>
{
btn.Hide();
});
};
WX.RequirePrivacyAuthorize(rpao);
}
};
WX.GetSetting(gsoinfo);
untiy的createuserinfobutton中创建的button是透明的