OnDestroy notification?

I'd like to be notified when object is about to be destroyed. I don't see a GameObject.OnDestroy method, any way to know this?

Edit: OnDestroy now exists in Unity 3.2. No need for hacks anymore!

Use OnDisable. You can determine whether the script is being disabled or the object is destroyed/deactivated like this:

function OnDisable() { 
   if (gameObject.active) { 
      print ("Disabled");
   } 
   else { 
      print ("Destroyed or set inactive");
   } 
}

NOTE! The above code longer works the same in Unity 3. It works like this instead, which seems less useful:

function OnDisable() { 
   if (gameObject.active) { 
      print ("Disabled or Destroyed");
   } 
   else { 
      print ("Set inactive");
   } 
}