Import achievement data
Use the import feature of the Achievement Editor to bulk import achievement data from a CSV file. This is useful if you have many achievements to add, or if you want to update existing achievements in bulk. You can also export achievement data to a CSV file to update externally and re-import if required.
CSV format
The CSV file must follow a specific format in order for achievement data to import successfully.
Required information
| Column name | Description |
|---|---|
| ID | The unique identifier for the achievement. When entering achievement IDs, the following restrictions apply:
|
| Progress_Target | Use Progress_Target to define the type of achievement:
|
| Unity.<PlatformService> | Set an achievement ID for each platform service you want to use. The column heading is Unity. followed by the platform service name, for example Unity.Steam, Unity.PlayGamesServices, or Unity.GameKit. There aren't any character restrictions on platform-specific achievement IDs. |
Example
The following example shows a CSV file with achievement data for Steam, Google Play Games Services, and GameKit:
ID,Progress_Target,Unity.Steam,Unity.PlayGamesServices,Unity.GameKit
AE1,1,AE1,4t0OEAIQAQ,AE1
AE2,1,AE2,C4t0OEAIQAg,AE2
AE3,1,AE3,4t0OEAIQDg,AE3
AP1,100,AP1,4t0OEAIQBA,AP1
AP2,10000,AP2,4t0OEAIQBQ,AP2
AP3,150,AP3,4t0OEAIQBg,AP3
AP4,30,AP4,4t0OEAIQCQ,AP4
AP5,100,AP5,4t0OEAIQCg,AP5
AP6,100,AP6,4t0OEAIQCw,AP6
AP7,2147483647,AP7,C4t0OEAIQDQ,AP7
AP8,5,AP8,4t0OEAIQDw,AP8
Tip
To get the exact column heading names for your project, export your achievement data before you create a CSV file. The exported file contains a Unity.<PlatformService> column, such as Unity.Steam, for each platform package installed in your project that supports achievements. Refer to Export a CSV file for more information.
Import a CSV file
To import achievement data from a CSV file, use the following steps:
Note
Importing achievement data from a CSV file overrides all existing achievement data in the Achievement Editor. It's recommended to make a backup of your existing Achievement Editor data before proceeding with an import. Refer to Export a CSV file for instructions on exporting achievement data.
- In the Unity Editor, open the Achievement Editor window by selecting Window > Platform Toolkit > Achievement Editor.
- In the Achievement Editor window, select the Import button.
- In the file dialog, select the CSV file you want to import.
- Click Open to start the import process.
Import rules
The following rules apply when importing achievement data from a CSV file:
- The
IDvalue serves as the primary key. It must not repeat in the ID column, and must not be empty. - If the CSV contains columns for platforms that aren't installed, the import process ignores those columns.
- If the Achievement Editor contains achievements that aren't in the CSV, the import process removes those achievements.
- If the CSV contains achievements not in the Achievement Editor, the import process creates those achievements.
- The import process overrides all fields in the Achievement Editor with their CSV equivalents.
- Unity displays a warning if the CSV doesn't contain a column for a known platform.
- If the CSV doesn't contain a column for a known platform, the import process doesn't change the data for that platform.
- If the CSV doesn't contain one of the common achievement headers, the import process aborts, doesn't change any data, and displays an error.
- If the CSV contains any errors, for example a row length mismatch or data type mismatch, the import process fails and doesn't update any data.
Export a CSV file
To export achievement data to a CSV file, use the following steps:
- In the Unity Editor, open the Achievement Editor window by selecting Window > Platform Toolkit > Achievement Editor.
- In the Achievement Editor window, select the Export button.
- In the file dialog, choose the location and file name for the CSV file.
You can then manually edit the exported CSV file and re-import it if required.