Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


operator !=(AssetKey, AssetKey)

Compares two keys for inequality.
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 different assets; otherwise,
false
.

Remarks

The negation of AssetKey.Equals: the keys differ when their address, sub-asset name, or AssetKey.Type differ.
Distinguish two keys that share an address but differ by type.

Examples

using Unity.Localization.Providers;using UnityEngine;namespace Unity.Localization.Samples{ public class AssetKeyInequalityOperatorExample { public void Run() { var texture = new AssetKey("UI/Logo", typeof(Texture2D)); var sprite = new AssetKey("UI/Logo", typeof(Sprite)); Debug.Log(texture != sprite); // True: same address, different type } }}