16 changes: 14 additions & 2 deletions Assets/Scripts/GameLobby/Auth/SubIdentity_Authentication.cs
@@ -1,4 +1,4 @@
using System;
using System;
using Unity.Services.Authentication;
using Unity.Services.Core;

Expand Down Expand Up @@ -35,6 +35,18 @@ public void Dispose()
private async void DoSignIn(Action onSigninComplete)
{
await UnityServices.InitializeAsync();

#if UNITY_EDITOR
if (ParrelSync.ClonesManager.IsClone())
{
// When using a ParrelSync clone, we'll automatically switch to a different authentication profile.
// This will cause the clone to sign in as a different anonymous user account. If you're going to use
// authentication profiles for some other purpose, you may need to change the profile name.
string customArgument = ParrelSync.ClonesManager.GetArgument();
AuthenticationService.Instance.SwitchProfile($"Clone_{customArgument}_Profile");
}
#endif

AuthenticationService.Instance.SignedIn += OnSignInChange;
AuthenticationService.Instance.SignedOut += OnSignInChange;

Expand All @@ -44,7 +56,7 @@ private async void DoSignIn(Action onSigninComplete)
onSigninComplete?.Invoke();
}
catch
{ UnityEngine.Debug.LogError("Failed to login. Did you remember to set your Project ID under Services > General Settings?");
{ UnityEngine.Debug.LogError("Login failed. Did you remember to set your Project ID under Edit > Project Settings... > Services?");
throw;
}

Expand Down
5 changes: 0 additions & 5 deletions Assets/Scripts/GameLobby/Game/GameManager.cs
Expand Up @@ -59,11 +59,6 @@ public void SetLobbyColorFilter(int color)

private void Awake()
{
// Do some arbitrary operations to instantiate singletons.
#pragma warning disable IDE0059 // Unnecessary assignment of a value
var unused = Locator.Get;
#pragma warning restore IDE0059

Locator.Get.Provide(new Auth.Identity(OnAuthSignIn));
Application.wantsToQuit += OnWantToQuit;
}
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/GameLobby/LobbyRelaySample.asmdef
Expand Up @@ -12,7 +12,8 @@
"GUID:4ebbcb26024b547159a86c39de1a8fa5",
"GUID:3bf5041814073ec4089849c425919d5a",
"GUID:1491147abca9d7d4bb7105af628b223e",
"GUID:3b8ed52f1b5c64994af4c4e0aa4b6c4b"
"GUID:3b8ed52f1b5c64994af4c4e0aa4b6c4b",
"GUID:894a6cc6ed5cd2645bb542978cbed6a9"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
1 change: 1 addition & 0 deletions Packages/manifest.json
Expand Up @@ -21,6 +21,7 @@
"com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.20-preview",
"com.unity.transport": "1.0.0-pre.9",
"com.unity.ugui": "1.0.0",
"com.veriorpies.parrelsync": "https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
7 changes: 7 additions & 0 deletions Packages/packages-lock.json
Expand Up @@ -283,6 +283,13 @@
"com.unity.modules.imgui": "1.0.0"
}
},
"com.veriorpies.parrelsync": {
"version": "https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "f45424822189ebd875d864a17d7f03b72eafbff7"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
Expand Down