Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

FileTableProvider

class in Unity.Localization.Providers.FileTables


Implements interfaces:IAssetProvider, IAsyncAssetProvider, ILocaleDiscovery

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

An asset provider that serves a table by reading a data file and reconstructing the table in memory.

A table whose entries all round-trip as plain data never ships its authored asset; a table holding object references (entries that are not IFileDataEntry) keeps its asset in the build, and those entries are grafted onto the file-built table at load. One file is written per table per locale, named {collectionName}_{localeCode}.{extension}. Subclass and return an ITableFileReader to add a format; JSON is the default (JsonResourceProvider). In a player build the files live under StreamingAssets/{SubPath}. In the editor a base-path override points the provider at the Library folder, so nothing is written into the project, and in the default Play Mode mode the provider serves the live table assets and reads no files at all.

Additional resources: JsonResourceProvider, ITableFileReader, IAssetProvider

Properties

Property Description
Collections The collections this provider serves.
FileExtension The file extension the format uses, without the leading dot.
PlayMode What this provider serves in the editor when entering Play Mode.
Reader Reads a table snapshot from a file in this provider's format.
SubPath The subfolder within StreamingAssets the files are placed in, customizable per provider.

Public Methods

Method Description
AddCollection Records a collection so its addresses resolve at runtime.
ClearCollections Removes every collection this provider serves.
RemoveCollection Removes a collection so this provider no longer serves its addresses.

Static Methods

Method Description
FileName The file name a table is stored under, with characters invalid in a file name replaced.