If the number is the same as script piece

Hi every one. I was wondering how i could get Unity to check if a static variable from another script is the same as a variable in the main script is the same. something like

var thisdoor = 1;
 if(DoorOpen.doornumber = thisdoor) //if static variable is the same as a variable in this script
    animation.play...

Thanks.

The correct way of doing this is:

var thisdoor = 1;
if (DoorOpen.doornumber == thisdoor) {
    animation.play...
}

I'm a bit surprised that UnityScript doesn't give you a compilation error when you try doing:

var thisdoor = 1;
if (DoorOpen.doornumber = thisdoor) {
    animation.play...
}

C# certainly would tell you that you are doing something wrong here (I think it even tells you that you're doing an assignment instead of a comparison and that a bool is expected but you are giving it an int).

... but maybe it was just an uncompiled example? ;-)