Data file tables
Understand how table collections ship and load as data files instead of assets.
Read time 3 minutesLast updated 13 days ago
Understand how table collections ship and load as data files instead of assets.
With a data-file source, a collection's tables ship in the build as plain files, one per locale, instead of serialized assets. Translators can read and edit the files, you can patch a build without a rebuild, and you can add a language with a new file. The built-in format is JSON ().
JsonResourceProviderYou can also create your own data-file source for custom file formats. Refer to Create a file table provider for text files.
Files and naming
Each table becomes one file named , for example . In a build, the files sit in . defaults to , and you can change it on the source in the Localization settings.
[collection-name]_[locale-code].[extension]Menus_fr.jsonStreamingAssets/{SubPath}SubPathLocalizationTablesFrom authoring to runtime
Unity generates data-file tables at build time and rebuilds them from files at runtime.
You author the collection in the Resource Tables window. The files are an export the build produces, not something you edit in the project. At build time, Unity generates the files into the project's folder and stages them into . At runtime, the source reads a table's file the first time it needs the table and rebuilds it in memory.
LibraryStreamingAssetsThe file preserves string values and plain-data entries. Some entries can't ship in a file: direct object references, and entries flagged Exclude entry from player export. Unity ships these entries in a baked table asset and merges them into the file-built table at load time. The build log lists which tables kept entries in the baked asset.
Test in Play mode
Each data-file source has a Play Mode Source option in its section of the Localization settings. This option controls what Play mode uses:
Value | Description |
|---|---|
| Source assets | Serves the live authored tables. This is the default, and changes in the table editor apply immediately. |
| Generated files | Generates the files and reads them the same way a build does. Exercises the real file path without a Player build. |
Platform behavior
File reads need direct file access to . On Android and Web, is a URL. On these platforms, Localization fetches the files with a web request and skips locale discovery, so you can't add languages after release this way. Refer to Add a language to a built Player.
StreamingAssetsStreamingAssetsCustom file formats
The JSON data-file source consists of scripts to read and write the files, along with a . To ship tables in your own format instead of JSON, refer to Create a file table provider for text files.
FileTableProvider