Object.operator == Manual     Reference     Scripting  
Scripting > Runtime Classes > Object
Object.operator ==

static operator == (x : Object, y : Object) : bool

Description

Compares if two objects refer to the same

var target : Collider;
function OnTriggerEnter (trigger : Collider)
{
if (trigger == target)
print("We hit the target trigger");
}
var target : Transform;
function Update ()
{
// Early out if the target is gone
if (target == null)
return;
}