2016-08-16 125 views

回答

1

使用社交界面。

您与

Social.localUser.Authenticate(callback); 

验证即可进入使用

Social.localUser 

见下

using UnityEngine; 
class c { 
    void foo() { 
     Social.localUser.Authenticate (success => { 
     if (success) { 
      Debug.Log ("Authentication successful"); 
      string userInfo = "Username: " + Social.localUser.userName + 
       "\nUser ID: " + Social.localUser.id + 
       "\nIsUnderage: " + Social.localUser.underage; 
      Debug.Log (userInfo); 
     } 
     else 
      Debug.Log ("Authentication failed"); 
    }); 
    } 
} 

https://docs.unity3d.com/ScriptReference/Social-localUser.html的例子。如果所有的用户信息和玩家有关的信息你需求是不可用的,但应该(通过本地的gamecenter API),然后你可能需要下载另一个平台插件以便与Social界面一起使用(就像你必须为Android所做的一样)

+0

我刚刚检查了苹果游戏套件文档,它不允许给出电子邮件,名字和姓氏https: //developer.apple.com/library/ios/documentation/GameKit/Reference/GKPlayer_Ref/index.html#//apple_ref/occ/instp/GKPlayer/playerID – GNChishti

+0

纠正我,如果我错了......谢谢 – GNChishti

+0

根据你的链接,你可以使用 'alias'(一个由玩家选择的字符串来标识他自己给其他玩家)和'displayName'(一个显示给玩家的字符串)。我认为第二个是名字 - 名字,以特定的格式。我没有在IOS上找到关于电子邮件的任何信息(我知道它可以在Android上使用),所以你可能对它是正确的。 –

相关问题