Requirements
Unity 2018.3+
The project was created with Unity 2018.3 and requires that version or later.
Visual Studio 2017+
Visual Studio 2017 (Update 15.7) or later is required to open and build the project.
Android / iOS device
A physical or virtual Android/iOS device provides the best experience.
PlayFab title ID
A valid PlayFab Title ID must be configured before running the sample.
PlayFab configuration
Before running the sample you must supply your PlayFab Title ID. You can do this in one of two ways:- Use the PlayFab Editor Extensions for Unity, or
- Open
Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.assetin the Unity Inspector and set the Title ID field directly.
Setup
Configure your Title ID
Either use the PlayFab Editor Extensions panel, or set the Title ID directly in
Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset.Using the sample
After launch you are prompted to sign in. The available options are:- Email / password login — authenticate with an existing PlayFab account.
- Create account — register a new account with an email and password.
- Guest login — sign in anonymously without credentials.
- Remember me — persist sign-in info so the dialog is skipped on the next run.
Code structure
All scripts live inAssets/Scripts/, split into two sub-folders:
PlayFab/ — authentication logic
PlayFab/ — authentication logic
| File | Responsibility |
|---|---|
PlayFabAuthService.cs | Encapsulates all PlayFab authentication calls: anonymous login, email/password login, account registration, and session-token persistence. |
UI/ — interface layer
UI/ — interface layer
| File | Responsibility |
|---|---|
LoginWindowView.cs | Drives the sign-in dialog, binds UI events to PlayFabAuthService, and manages the “remember me” toggle state. |
Key PlayFab features
LoginWithEmailAddress
Authenticates a returning player using their email and password.
RegisterPlayFabUser
Creates a new account with email, password, and optional display name.
LoginWithCustomID
Provides anonymous guest login via a device-generated custom ID.
Session persistence
Saves the session ticket locally so players are not prompted again on subsequent runs.
