Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

AssetKey.operator !=

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

Cancel

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

Parameters

Parameter Description
a The first key.
b The second key.

Returns

bool true if the keys identify different assets; otherwise, false.

Description

Compares two keys for inequality.

The negation of AssetKey.Equals: the keys differ when their address, sub-asset name, or AssetKey.Type differ.

<para>Distinguish two keys that share an address but differ by type.</para>

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