onUnmount method

  1. @override
void onUnmount()
override

Called when the owning node leaves a live scene graph.

Implementation

@override
void onUnmount() {
  final handle = _handle;
  if (handle != null) _sim?.destroyBody(handle);
  _handle = null;
  _world = null;
}