GetCollections()
Gets every table collection in the project.
Read time 1 minuteLast updated 6 hours ago
Definition
- Type: Method
- Namespace: Unity.Localization.Editor
- Assembly: UnityEditor
public static IReadOnlyList<ResourceTableCollection> GetCollections()
Returns
Type | Description |
|---|---|
| IReadOnlyList<ResourceTableCollection> | A read-only list of the project's table collections. The list is empty when there are none. |
Remarks
Finds the ResourceTableCollection assets with the asset database. The list is a snapshot, so call this again after LocalizationEditorSettings.CollectionsChanged is raised.
Additional Resources: LocalizationEditorSettings.GetCollection, ResourceTableCollection
Logs the name and table count of every collection.
Examples
using Unity.Localization.Editor;using UnityEngine;namespace Unity.Localization.Samples{ public class GetCollectionsExample { public void Run() { foreach (var collection in LocalizationEditorSettings.GetCollections()) Debug.Log(collection.TableCollectionName + " has " + collection.Tables.Count + " tables"); } }}