Any way to show / compare links to objects in the viewport?

When debugging, sometimes I have to compare object references in the viewport to see if two variables actually refer to the same object.

With C ++ and pointers, this is easy, but is there a way to do this using C # references?

+6
source share
2 answers

There is actually a built-in function for comparing objects in the "Clock" window, which does not require a direct call to any functions. It is in the right-click menu, like "Make Object ID"

Make Object ID

It will mark the object with an identifier, and then you can add a second object and mark it with an identifier as well. If this object is the same link, then they will have the same identifier. This allows you to see if they have changed / when they are being debugged.

+13
source
object.ReferenceEquals(objA, objB) 
+5
source

Source: https://habr.com/ru/post/912921/


All Articles