I would recommend to separately compare the r, g, b and a variables (respectively only the ones you need).
Also try printing the values of colour2 separately (eg. "print(colour2.r + ", " + colour2.g + ", " + colour2.b + ", " + colour2.a)") and check if they are REALLY equal to colour1. Unity logs often skip decimals.
You could also try out the following:
if(colour1.Equals(colour2))
{
// Do stuff
}
(but I don't know if this is actually the same as the == operator)
**UPDATE:**
As I said, Unity log often skips decimals.
To compare those values up to 3 decimals you could do the following:
if((int)(colour1.r * 1000) == (int)(colour2.r * 1000))
{
// Do stuff
}
↧