Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


operator ==(AssetKey, AssetKey)

Compares two keys for equality.
Read time 1 minuteLast updated 13 days ago

Definition

public static bool operator ==(AssetKey a, AssetKey b)

Parameters

The first key.

The second key.

Returns

Type

Description

bool
true
if the keys identify the same asset; otherwise,
false
.

Remarks

Equivalent to AssetKey.Equals: the keys match when their address, sub-asset name, and AssetKey.Type all match.
Compare two keys with the equality operator.

Examples

using Unity.Localization.Providers;using UnityEngine;namespace Unity.Localization.Samples{ public class AssetKeyEqualityOperatorExample { public void Run() { var a = new AssetKey("UI/Logo", typeof(Texture2D)); var b = new AssetKey("UI/Logo", typeof(Texture2D)); Debug.Log(a == b); // True } }}