Description, details and error message(s)
I am trying to follow the docs on Cloud Storage:
Cloud Storage | coherence Documentation
However, the first example has invalid code. My editor insists that there is no CloudStorage in CloudService. And it’s not even listed in the API.
CloudService
using Coherence.Toolkit;
using UnityEngine;
// the example should also have this line to make sense:
using Coherence.Cloud;
class SaveExample : MonoBehaviour
{
public StorageObjectId objectId = ("Greeter", 1);
async void Start()
{
// Get main player account once it has logged in.
PlayerAccount playerAccount = await PlayerAccount.GetMainAsync();
// Save the string "Hello, World!" in cloud storage:
var cloudStorage => playerAccount.Services.CloudStorage;
await cloudStorage.SaveObjectAsync(objectId, "Hello, World!");
}
}
I reinstalled Coherence to make sure I was up to date. It says 1.6.0 in the package manager and v1.5.1 elsewhere in the editor. I don’t know if that’s relevant, but originally I didn’t recognise PlayerAccount as a class, but the update fixed that issue and not this current problem. I updated by removing the package and following the steps here:
Unity Multiplayer Networking Install SDK | coherence
Expected behaviour
Code in the docs not having errors.
Screenshots
How to reproduce
Try to use the example code I guess.
Environment
SDK: 1.6.0 (I think)
Unity: 2022.3.17f1, Visual Studio Community 2022
OS/Platform: Windows 11