Hi,
I might be misunderstanding something, but it seems like async isn’t working? When I authenticate the user, my game freezes for around 2-3 seconds as it authenticated.
- Load in Scene
- On Scene Start - Authenticate User and also Play video
Do I misunderstand async or is there a bug? Why when I authenticate the user does the video not play until the authentication is finished?
private async void Start()
{
if(Utilities.CheckForInternetConnection())
{
await InitializeUnityServices();
await SignInUser();
}
}
private async Task InitializeUnityServices()
{
InitializationOptions options = new InitializationOptions();
#if UNITY_EDITOR || DEBUG_TOOLS
options.SetEnvironmentName("development");
#else
options.SetEnvironmentName("production");
#endif
if(UnityServices.State == ServicesInitializationState.Uninitialized)
{
await UnityServices.InitializeAsync();
}
}
private async Task SignInUser()
{
if(!AuthenticationService.Instance.IsSignedIn)
{
await AuthenticationService.Instance.SignInAnonymouslyAsync();
}
}
Thanks