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

TableEntryReference.Equals

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 bool Equals(TableEntryReference other);

Parameters

Parameter Description
other The entry reference to compare with this one.

Returns

bool true if both references identify the same entry; otherwise, false.

Description

Checks whether this reference identifies the same entry as another.

References compare the way they resolve: an id reference compares by key id and ignores any key text (the id wins during resolution too), and a name reference compares by ordinal key text. References of different forms are not equal. Empty references are equal to each other.

<para>Compare two entry references for value equality.</para>

using Unity.Localization;

namespace Unity.Localization.Samples { public class TableEntryReferenceEqualsExample { public bool Run() { TableEntryReference a = "Menu/Start"; TableEntryReference b = 12345L; return a.Equals(b); } } }

Declaration

public bool Equals(Object obj);

Parameters

Parameter Description
obj The object to compare with this reference.

Returns

bool true if obj is an entry reference that identifies the same entry; otherwise, false.

Description

Checks whether this reference equals another object.

Returns false when obj is not a TableEntryReference. Otherwise, defers to TableEntryReference.Equals for value comparison.

<para>Compare against a boxed reference.</para>

using Unity.Localization;

namespace Unity.Localization.Samples { public class TableEntryReferenceEqualsObjectExample { public bool Run(TableEntryReference entryReference) { object boxed = (TableEntryReference)"Menu/Start"; return entryReference.Equals(boxed); } } }