int An integer hash code derived from the address, sub-asset name, and type.
Computes a hash code for this key.
Consistent with AssetKey.Equals: keys that compare equal produce the same hash code. Derived from
the address, sub-asset name, and type, so a key is safe to use as a dictionary key for a load cache.
<para>Use a key as a dictionary key for loaded assets.</para>
using System.Collections.Generic; using Unity.Localization.Providers; using UnityEngine;
namespace Unity.Localization.Samples { public class AssetKeyHashCodeExample { public void Run() { var loaded = new Dictionary<AssetKey, Texture2D>(); var key = new AssetKey("UI/Logo", typeof(Texture2D)); loaded[key] = new Texture2D(2, 2);
Debug.Log(loaded.ContainsKey(new AssetKey("UI/Logo", typeof(Texture2D)))); // True } } }