Is there any counterpart for the Start event which fires when the affected object is about to be destroyed, or is there any sensible way of getting this effect? At the moment, I'm handling this manually, by having my 'exploding object' class send a message to all scripts on the object, but that doesn't really help in the general sense because it's necessary to manually trigger the event. I tried using the destructor, but of course this doesn't work well, as the destructor fires at unexpected times (like when you're in the editor).
OnDisable has since been implemented to address this particular situation, although it does have the disadvantage that it fires for various other things as well as script destruction (such as, of course, being disabled).
Ok would be nice if it got seperated out. UT is there a posibility that this will happen at some point?
Don't know how exactly you are doing it, but you could emulate this behavior in the following way: Code (csharp): public MyClass : MonoBehaviour{ public void Destroy(){ // do something here... Destroy( gameObject ); } } // then when you want do destroy just get the component and destroy it ((MyClass)GetComponent(typeof(MyClass))).Destroy(); Regards, Afonso