Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetHashCode()

Computes a hash code for this reference.
Read time 1 minuteLast updated 16 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 TableReference.Equals: references that compare equal produce the same hash code, including GUIDs that differ only by case or dashes, because TableReference.FromGuid canonicalizes them. Safe to use as a dictionary key.
Use a table reference as a dictionary key.

Examples

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