Documentation

Unity Engine

Download Unity

Unity Engine

GetCollection(TableReference)

Gets the table collection that a table reference points to.
Read time 1 minuteLast updated 6 hours ago

Definition

public static ResourceTableCollection GetCollection(TableReference tableReference)

Parameters

tableReference

The name or GUID of the collection to find.

Returns

Type

Description

ResourceTableCollectionThe matching collection, or
null
when the reference is empty or no collection matches.

Remarks

A reference made from a name matches ResourceTableCollection.TableCollectionName. A reference made from a GUID matches SharedTableData.TableCollectionNameGuid of the collection's shared data.
Finds a collection by name and reads its French table.

Examples

using Unity.Localization.Editor;using UnityEngine;namespace Unity.Localization.Samples{ public class GetCollectionExample { public void Run() { var collection = LocalizationEditorSettings.GetCollection("Menu"); if (collection == null) return; var french = collection.GetTable("fr"); Debug.Log("Menu has a French table: " + (french != null)); } }}