quot;UGS ready. PlayerId={AuthenticationService.Instance.PlayerId}"); } } ``` `UnityServices.State` / `ServicesInitializationState` is the same guard as High Scores Part 4. Confirm the enum in the Services Core Scripting API if the Editor warns. Call this from a startup `async` method ([[1. Awaitable versus Coroutines and Task]]), not from `Awake` without a continuation, and not on every save click without the `IsSignedIn` guard. Catch initialization and sign-in failures: **the game must still load and write the local slot**. Other identity providers exist in the Authentication docs (platform logins, etc.). This series uses **anonymous** only so a classroom machine can sync without a store login. Configure additional providers in the dashboard if you add them later; do not invent those APIs here. `IsSignedIn` can remain true after a token expires; Authentication session-management docs also mention `IsAuthorized` for "is the access token currently valid." If a Cloud Save call fails with an auth error after the app was backgrounded, confirm those properties and sign in again rather than inventing a refresh helper. ## 2.2 Player ID is the namespace `AuthenticationService.Instance.PlayerId` is how Cloud Save knows *whose* `slot_0` you meant. Two Editor installs that do not share a cached token are **two players**, even on one machine. That is expected. If a student reports "the cloud slot is empty" after deleting Player data or switching machines, they may have a new anonymous ID - not a broken `LoadAsync`. If you later add Multiplayer Play Mode or two clients, each virtual player should be a distinct anonymous player (the Multiplayer series already says this). Do not share one token file between two clients and then wonder why write locks conflict (part 4). ## 2.3 Exercise Enter Play Mode, run `EnsureSignedInAsync`, log `PlayerId`. Stop and enter Play Mode again: official anonymous behavior is to restore the same player if the session token was cached. Then, only if you are willing to lose that anonymous identity, clear the project's player data and confirm you get a **new** `PlayerId` - so the class has seen both outcomes. Do not make "delete PlayerPrefs" a troubleshooting first step on a machine that also stores other settings there. ## Sources - Anonymous sign-in: https://docs.unity.com/en-us/authentication/use-anon-sign-in - Authentication 6000.5: https://docs.unity3d.com/6000.5/Documentation/Manual/com.unity.services.authentication.html - [[1. Services Project and Authentication]]