#How do you guys usually approach Unity
1 messages · Page 1 of 1 (latest)
+1 I'm also interested in responses regarding what people are doing in practice too 🙂
There is an AuthenticationManager class in the ServerlessMultiplayerGame sample:
https://github.com/Unity-Technologies/com.unity.services.samples.use-cases/blob/main/Assets/Use Case Samples/Serverless Multiplayer Game/Scripts/Menu/AuthenticationManager.cs
It's interesting because it ALSO shows a pattern that involves Profiles, although not all games use profiles (and almost certainly most mobile games do not, as they are scoped to an account linked to the device account), they are useful for console games though.
Once signed in you SHOULD stay signed in and the session should be automatically refresh so in practice it shouldn't matter too much where you put the code, but it's worth listening for events in case something goes wrong, so you can attempt to sign in again - and/or signal to the player.
*Note: This is true except on consoles - specifically on Xbox, PlayStation and Nintendo Switch - where you need to manually refresh a token every < 60 minutes.
I'd like us to provide better guidance on the docs site and in the SDK samples.
We are working towards that and actually just did a bit of an overhaul of the authentication docs site earlier this month but there are a lot of different patterns games use for various reasons - especially on mobile and PC - and we want to try and get the framing right to explain why we think some patterns are better than others.