onDestroy

open fun onDestroy()

Called when destroy is invoked and all of its children have been destroyed.


List of 'destroy' callbacks called when destroy is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

node {
onDestroy += {
// handle extra destroy logic
}
}