文档

Unity Engine

Unity Engine

operator ==(AssetKey, AssetKey)

Compares two keys for equality.
阅读时间1 分钟最后更新于 1 个月前

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 } }}