You must enable Cloud Save from the Unity Dashboard before using the service. Once enabled, you can install the Cloud Save SDK into your project in the Unity Engine. You can use the Unity Dashboard to look up the data for a player.
Another way to use Cloud Save is through integration with Cloud Code.
You must link your project with the Unity Dashboard to use the Cloud Save service.
- In Unity Editor, select Edit > Project Settings... > Services.
- Link your project.
If your project doesn't have a Unity project ID:
- Select Create a Unity Project ID > Organizations, then select an organization from the dropdown menu.
- Select Create project ID.
If you have an existing Unity project ID to use:
- Select Use an existing Unity project ID.
- Select an organization and a project from the dropdown menus.
- Select Link project ID.
Your Unity Project ID appears and the project is now linked to Unity cloud services. You can also access your project ID in a Unity Editor script using
Before you can use Cloud Save, you need to enable your project in Unity Dashboard:
- Go to the Unity Dashboard.
- Sign in using your Unity ID.
- In the Main Menu, select Explore Services (if not already selected).
- In the main window, under either the All Solutions or LiveOps tabs, select on Cloud Save.
- Select Set up Cloud Save.
To install the latest Cloud Save package for Unity:
- In the Unity Editor, open Window > Package Manager.
- In the Package Manager, select the Unity Registry list view.
- Search for
com.unity.services.cloudsave, or locate the Cloud Save package in the list.
- Select the package, then select Install.
Refer to the Package Manager documentation for more information.
Optionally, you can import the Samples folder into your project to find examples of how to use the Cloud Save Client API. You can find the Samples folder in Package Manager > Cloud Save > Samples.
To get started with the Cloud Save SDK:
- Ensure the service is enabled via the Cloud Save service dashboard page.
- Ensure that you have installed both the Cloud Save and the Authentication SDKs.
- Install the required version of the package using the Package Manager.
- Sign in to your cloud project from within Unity Editor by selecting Edit > Project Settings > Services.
- Create a new C# MonoBehaviour script in Unity Editor. For more information refer to Creating and Using Scripts.
- In the script. initialize the Core SDK using
- In the script, initialize sign in using the Authentication SDK.
The Cloud Save SDK is ready to use once you have signed in with the Authentication SDK. You can then call any of the Cloud Save methods to start interacting with your data.
Apps typically need to know the identity of a user to provide a variety of features and services to both game developers and players to ensure security, consistency, and safety with every interaction.
The Cloud Code API uses JSON Web Token (JWT) authentication. The Cloud Save package automatically supplies JWT, but you need to make sure to sign your players in.
The fastest way to get started is to use anonymous authentication. The End to end initialization and authentication flow example demonstrates how to:
- Start anonymous authentication using the authentication package.
- Log the player ID in a script within Unity.