Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

TableReference.FromGuid

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static TableReference FromGuid(string tableCollectionNameGuid);

Parameters

Parameter Description
tableCollectionNameGuid The GUID of the table collection to reference.

Returns

TableReference A table reference that identifies the collection by GUID.

Description

Creates a table reference that identifies a collection by its GUID.

GUID references keep resolving after a collection is renamed, unlike name references. Dashed or differently cased input is accepted and canonicalized, so it compares equal to its plain hex form. The result has a TableReference.ReferenceType of Guid, or Empty when the string is not a valid GUID.

<para>Reference a collection by GUID so it survives a rename.</para>

using Unity.Localization;

namespace Unity.Localization.Samples { public class TableReferenceFromGuidExample { public TableReference Run() => TableReference.FromGuid("6f1e2c0a9b3d4e5f8a1b2c3d4e5f6a7b"); } }

Declaration

public static TableReference FromGuid(GUID tableCollectionNameGuid);

Parameters

Parameter Description
tableCollectionNameGuid The GUID of the table collection to reference.

Returns

TableReference A table reference that identifies the collection by GUID.

Description

Creates a table reference that identifies a collection by its GUID.

Use this overload when you already hold a GUID, for example one returned by the asset database. The result has a TableReference.ReferenceType of Guid, or Empty when the GUID is empty.

<para>Reference a collection from a GUID you already hold.</para>

using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples { public class TableReferenceFromTypedGuidExample { public TableReference Run(GUID collectionGuid) => TableReference.FromGuid(collectionGuid); } }