Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Parameters
| Parameter |
Description |
| a |
The first key. |
| b |
The second key. |
Returns
bool
true if the keys identify the same asset; otherwise, false.
Description
Compares two keys for equality.
Equivalent to AssetKey.Equals: the keys match when their address, sub-asset name, and
AssetKey.Type all match.
<para>Compare two keys with the equality operator.</para>
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
}
}
}