onUnmount method

  1. @override
void onUnmount()
override

Called when the owning node leaves a live scene graph.

Implementation

@override
void onUnmount() {
  final world = _world;
  if (world != null) {
    final handle = _handle;
    if (handle != null) world.simulation.destroyJoint(handle);
    final anchor = _anchorHandle;
    if (anchor != null) world.simulation.destroyAnchorBody(anchor);
  }
  _handle = null;
  _anchorHandle = null;
  _world = null;
}