PlayFab Hub samples¶
On this page
Three sample sets each demonstrate uGUI (Canvas + TextMeshPro) and UI Toolkit:
| Set | What it demonstrates |
|---|---|
| 01_Login | Email registration/login, optional guest login, logout |
| 02_Leaderboard | Top, around-player, and friend legacy statistic boards |
| 03_Shop | Economy v2 catalog, inventory, and virtual-currency purchase |
Common includes the Inspector UnityEvent bridge, UXML theme, and PanelSettings.
Ready-to-open demos¶
The Asset Store archive includes all six saved demos: 01_Login/LoginDemo.unity, 02_Leaderboard/LeaderboardDemo.unity, and 03_Shop/ShopDemo.unity for UI Toolkit, plus LoginDemo_uGUI.unity, LeaderboardDemo_uGUI.unity, and ShopDemo_uGUI.unity in their respective set folders. No scene generation is required. The UI Toolkit scenes use bundled controllers, UXML and Common panel/theme assets. The uGUI scenes use the standard TMP Essential Resources: import those resources before opening the uGUI demos so their font/material references resolve. Install the PlayFab SDK and sample dependencies first. For UPM, import all sample entries, including Common. Start with LoginDemo after creating your client settings; the leaderboard and shop require an authenticated session and the title configuration described below. No title credentials are embedded, and guest auto-login is disabled.
The six-scene generator remains available for both uGUI and UI Toolkit. Copy a demo before customizing it.
Setup¶
Read Documentation/getting-started.html and Documentation/authentication.html first. Install the separate PlayFab SDK. The main Hub works without TMP, but sample generation requires TextMeshPro and its Essential Resources (Window > TextMeshPro > Import TMP Essential Resources). On Unity 2022.3, install TextMeshPro 3.0.6 explicitly in Package Manager; Unity 6 uGUI 2.0 includes TMP.
An Asset Store import includes visible sources under Assets/PlayFabHub/Samples. For UPM, use Tools > MoDev > PlayFab Hub > Generate Sample Scenes to provision all sets, or import all four sample entries from Package Manager. Import the remaining sets before generation if you have already imported only some. Run Generate Sample Scenes after prerequisites are ready. It writes six scenes to Assets/PlayFabHub/Samples/Scenes and restores your open scene. Re-running deliberately regenerates those scenes; copy scenes elsewhere before customizing them.
Create client settings in the Hub and select your development title. Use the Login scene to register a disposable email account or log in. Anonymous creation is disabled by default for newer titles; Guest is an optional, explicitly configured development route. Guest auto-login is off. Samples do not issue a login when opened.
Leaderboard needs a legacy statistic (default high_score) and server-authoritative scores. The Shop needs published Economy v2 items, a valid price option, and inventory currency provisioned by your trusted backend. These samples do not grant currency or deploy production handlers. A shop click is a real virtual-currency purchase on the configured title.
Copy controllers and scenes before customizing. Runtime managers are UI independent. Disabled/unconfigured features show a status message rather than issuing the sample request.