Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2022 Graphics & Games

WWDC22 · 10 min · Graphics & Games

Reach new players with Game Center dashboard

Meet the Game Center activity dashboard and discover how it can help your game reach new players. We’ll introduce you to the dashboard and profiles and explore how they can track player achievements, high scores, and leaderboard changes for your game. We’ll also show you how to add Game Center to your Unity game project using the Game Center plug-in.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 4 snippets

Authenticate the local player swift · at 4:11 ↗
// Authenticate the local player
import GameKit

class TitleScreenViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Authenticate the local player
        GKLocalPlayer.local.authenticateHandler = { viewController, error in
            if let viewController = viewController {
                // Present the view controller from Game Center.
                return
            }
        }
    }
}
Authenticate the local player csharp · at 4:30 ↗
// Authenticate the local player
using Apple.GameKit;

public class MyGameManager : MonoBehaviour
{
    private GKLocalPlayer _localPlayer;

    private async Task Start()
    {
        try
        {
            _localPlayer = await GKLocalPlayer.Authenticate();
        }
        catch (Exception exception)
        {
            // Handle exception...
        }
    }
}
Show the Access Point swift · at 5:25 ↗
// Show the Access Point
import GameKit

class MenuScreenViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        GKAccessPoint.shared.location = .topLeading
        GKAccessPoint.shared.isActive = true
    }
}
Show the Access Point csharp · at 5:40 ↗
// Show the Access Point
GKAccessPoint.Shared.Location = 
    GKAcessPoint.GKAccessPointLocation.TopLeading;

GKAccessPoint.Shared.IsActive = true;

Resources