Upgrade 1.7 -> 1.8

Coherence Cloud Login

As part of 1.8, there's a new component called CoherenceCloudLogin that is now the recommended no-code method for logging in to coherence Cloud - as a Guest, or otherwise.

CoherenceBridge will for now also retains its Auto Login In As Guest functionality, however, starting now, it is recommended to start using CoherenceCloudLogin (or the CoherenceCloud API directly) instead.

Old way to access cloud services

In older versions Cloud Services would often be accessed via CoherenceBridge.CloudService.

[SerializeField] CoherenceBridge bridge;

IEnumerator Start()
{
	while (!bridge.CloudService.IsLoggedIn)
	{
		yield return null;
	}

	// Access cloud services:
	var cloudService = bridge.CloudService;
}

In 1.8 and later it's preferable to access cloud services via CoherenceCloudLogin.Services instead.

[SerializeField] CoherenceCloudLogin cloudLogin;

IEnumerator Start()
{
	while (!cloudLogin.IsLoggedIn)
	{
		yield return null;
	}

	// Access cloud services:
	var cloudService = cloudLogin.Services;
}

You can also disable Log In On Load on the CoherenceCloudLogin component, and trigger the log in operation manually whenever you're ready using the LogInAsync method.

The LogInAsync method is idempotent, meaning that even if it is executed multiple times, the CoherenceCloudLogin component will still only log into a single PlayerAccount.

[SerializeField] CoherenceCloudLogin cloudLogin;

async Awaitable Start()
{
	PlayerAccount playerAccount = await cloudLogin.LogInAsync()

	// Access cloud services:
	var cloudService = playerAccount.Services;
}

Alternatively, you can also use PlayerAccount.GetMainAsync to acquire a reference to the Main Player Account and gain access to its cloud services that way.

This can be useful when your component exist in a different scene or prefab than the CoherenceCloudLogin component.

The first Player Account that you log into becomes the Main Player Account by default.

async Awaitable Start()
{
	PlayerAccount playerAccount = await PlayerAccount.GetMainAsync();

	// Access cloud services:
	var cloudService = playerAccount.Services;
}

Read more about CoherenceCloudLogin.

If you experience issues upgrading, please reach to us on Discord.

Last updated

Was this helpful?