onUnmount method

  1. @override
void onUnmount()
override

Called when the owning node leaves a live scene graph.

Implementation

@override
void onUnmount() {
  // Guard on attachment, not mount state: Component.unmount clears the
  // mounted flag before onUnmount, and the render scene is still reachable
  // during teardown (mirrors DirectionalLightComponent).
  if (isAttached) {
    node.internalRenderScene?.removeEnvironmentVolumeComponent(this);
  }
}