1

I'm creating an iOS game which will require the player to have a Game Center account, so when they first play they need to sign into Game Center (if not already signed in), what I'm confused about is there's obviously a cancel button in the GameCenter sign-in ViewController, how can I disable that? or display some msg when it's tapped on?

4

3 回答 3

2

您不能禁用它,但在用户登录之前您不能显示任何内容。

于 2013-11-07T16:45:33.873 回答
0

您不能禁用取消按钮,但您可以检查玩家是否已成功登录

[localPlayer setAuthenticateHandler:^(UIViewController *login, NSError *) {
    if (localPlayer.authenticated) {
        NSLog(@"GameCenter authenticated");
    } else {
        NSLog(@"GameCenter didn't authenticate");
    }
}];
于 2013-11-07T16:49:29.423 回答
0

通常,您会显示某种带有“登录游戏中心”按钮的初始视图,并且可能会解释您的游戏和/或用户需要登录才能玩游戏的原因。按下登录按钮将显示 GameCenter 登录视图,如果用户取消,他们将仅停留在启动视图,直到再次点击登录按钮并成功登录。

于 2013-11-07T18:43:40.530 回答