Comparing two instances

Hi again people. I need help once again :stuck_out_tongue:
Is there any way to compare two objects to know if they are the instances of the same class ?

I have a class called condition which has a bunch of child
so i want to iterate an array with a ā€œcondition childrenā€, and compare with ā€œone childā€ to know if the array have any instance of the same class

well, if i didnt explain well enough i will post the code as soon is i get it, but if anyone understood and can help, you have my thanks

===== solved 2 posts down =====

Object.ReferenceEquals maybe?
http://msdn.microsoft.com/en-us/library/system.object.referenceequals.aspx

Something like this?

condition[] condition_children;
....
if (condition_children[i].GetType() == Typeof(type_you_want_to_check))
{
}

Oh, type? Type is different to instance. Different instances can be of the same type.

I would just use Equals, like so:

                Object first = new Object();
                Object copyOfFirst = first;
                Object second = new Object();
               Debug.Log(string.Format("First class == Second class? {0}, copy of first class == second class? {1}, copy of first class == first class? {2}", first.Equals(second), copyOfFirst.Equals(second), first.Equals(copyOfFirst)));

exactly what i wanted to know cdevl … thanks a lot =O
thanks elite and naraku =x i would have been more accurate if i had the code to post back then, but i wasn’t at work so sorry about that. But thanks for the answers anyway