Integrate with Unity Editor

The Leaderboards Authoring module (installed with the Leaderboards package) allows you to optionally author and modify Leaderboards configurations directly within the Unity Editor. You can then upload leaderboards from the Unity Editor to the Dashboard by using the Deployment package.

> [!NOTE]
> Authoring of Leaderboards configurations in the Unity Editor is only supported in Unity 2021.3 and above.

Leaderboards configurations existing in the Unity Editor allow users to treat their source control as the single source of truth (instead of the version in the cloud), simplifying actions such as rollbacks, bisection, and other common operations. For example, the Leaderboards Authoring module facilitates tasks like keeping client configurations in sync with remote configurations.

Prerequisites

To use Leaderboards configurations in the Unity Editor, you must first install the Leaderboards SDK and link your Unity Gaming Services project to the Unity Editor.

Link your Unity Gaming Services project with the Unity Editor. You can find your UGS project ID in the Unity Dashboard.

  1. In Unity Editor, select Edit > Project Settings > Services.
  2. Link your project.
  • If your project doesn't have a Unity project ID:
1.  Select **Create a Unity Project ID** > **Organizations**, then select an organization from the dropdown menu.
2.  Select **Create project ID**.
  • If you have an existing Unity project ID:
1.  Select **Use an existing Unity project ID**.
2.  Select an organization and a project from the dropdown menus.
3.  Select **Link project ID**.

Your Unity Project ID appears, and the project is now linked to Unity services. You can also access your project ID in a Unity Editor script using UnityEditor.CloudProjectSettings.projectId.

Install required packages

To create Leaderboards configurations within the Editor, you must install the following packages:

  • Deployment
  • Leaderboard (2.0.0 or greater)

Check Unity - Manual: Package Manager window to familiarize yourself with the Unity Package Manager interface.

To install these packages and add them to your list of available packages:

  1. From the Unity Editor’s Package Manager window, select + (add) > Add package by name….
  2. Enter com.unity.services.deployment.
  3. Select Add.
  4. Repeat these steps for com.unity.services.leaderboards.

Authoring within the Unity Editor

The Leaderboards Authoring module allows you to create, edit, and deploy Leaderboards configurations directly within the Unity Editor.

Create a configuration

Follow these steps to create a Leaderboards configuration using the Leaderboards Authoring module:

  1. In the Unity Editor, right-click in the Project window, then select Create > Leaderboards configuration.
  2. Name the configuration. Leaderboards configurations use their file name as the identifier when uploading to the service.
  3. Press Enter.

The new configuration is now visible in the Project window, and in the Deployment window, accessible by selecting Window > Deployment.

Edit a configuration

To edit an existing Leaderboards configuration, double-click the configuration in the Project window. Leaderboards configurations are in .json format and use the .lb file extension.

Deploy a configuration

You can deploy a configuration through the Deployment window. Check the Deployment package manual for more information.

Deployment window

The Deployment window is a core feature of the Deployment package. It allows all services to have a single cohesive interface for deployment needs, and allows you to upload cloud assets to their respective cloud services.

Check the Deployment package manual for more information.