Version: Unity 6 (6000.0)
LanguageEnglish
  • C#

GlobalObjectId.CompareTo

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

Declaration

public int CompareTo(GlobalObjectId other);

Parameters

other The other GlobalObjectId to compare with this instance.

Returns

int Returns an integer that represents the relative sort order positions of the current instance and the other GlobalObjectId. Returns a negative integer if this instance precedes other. Returns a positive integer if this instance follows other. Returns zero if this instance and other have the same position in the sort order.

Description

Compares this unique object identifier with another to determine their relative positions in the sort order.

The sort order for comparison is GlobalObjectId.assetGUID, GlobalObjectId.targetObjectId, GlobalObjectId.targetPrefabId, then GlobalObjectId.identifierType.

Note: To check if two instances of GlobalObjectId are equivalent, use GlobalObjectId.Equals instead.