GetCollection(TableReference)
Gets the table collection that a table reference points to.
Read time 1 minuteLast updated 6 hours ago
Definition
- Type: Method
- Namespace: Unity.Localization.Editor
- Assembly: UnityEditor
public static ResourceTableCollection GetCollection(TableReference tableReference)
Parameters
The name or GUID of the collection to find.
Returns
Type | Description |
|---|---|
| ResourceTableCollection | The matching collection, or |
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.
Additional Resources: LocalizationEditorSettings.GetCollections, TableReference
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)); } }}