Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetHashCode()

Computes a hash code for this reference.
Read time 1 minuteLast updated 8 days ago

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
public override int GetHashCode()

Returns

Type

Description

intAn integer hash code derived from the part of the reference that resolution uses.

Remarks

Consistent with TableEntryReference.Equals: references that compare equal produce the same hash code. Safe to use as a dictionary key.
Use an entry reference as a dictionary key.

Examples

using System.Collections.Generic;using Unity.Localization;namespace Unity.Localization.Samples{ public class TableEntryReferenceHashCodeExample { public void Run(TableEntryReference entryReference) { var counts = new Dictionary<TableEntryReference, int>(); counts[entryReference] = counts.GetValueOrDefault(entryReference) + 1; } }}