Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


FileTableProvider

An asset provider that serves a table by reading a data file and reconstructing the table in memory.
Read time 2 minutesLast updated 22 days ago

Definition

public abstract class FileTableProvider : IAsyncAssetProvider, IAssetProvider, ILocaleDiscovery

Remarks

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.

Properties

Property

Description

CollectionsThe collections this provider serves.
FileExtensionThe file extension the format uses, without the leading dot.
PlayModeWhat this provider serves in the editor when entering Play Mode.
ReaderReads a table snapshot from a file in this provider's format.
SubPathThe subfolder within StreamingAssets the files are placed in, customizable per provider.

Methods

Method

Description

AddCollectionRecords a collection so its addresses resolve at runtime.
ClearCollectionsRemoves every collection this provider serves.
RemoveCollectionRemoves a collection so this provider no longer serves its addresses.

Static Methods

Method

Description

FileNameThe file name a table is stored under, with characters invalid in a file name replaced.

Classes

Class

Description

FileTableProvider.CollectionRefA collection this provider serves, by guid and name so either address form resolves.