GetTable()
Returns the table synchronously if it is already loaded.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
public ResourceTable GetTable()
Returns
Type | Description |
|---|---|
| ResourceTable | The resolved table, or null when it is not available synchronously. |
Remarks
Does not trigger a load. The result is null when the table is not loaded yet, the reference is empty, or no resource database is configured. Use LocalizedTable.GetTableAsync to load the table on demand instead.
Read an already-loaded table.
Examples
using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class LocalizedTableGetTableExample { public void Read() { var localizedTable = new LocalizedTable(); localizedTable.TableReference = "My Strings"; ResourceTable table = localizedTable.GetTable(); if (table != null) Debug.Log(table.name); } }}