onRemove method

  1. @override
  2. @mustCallSuper
void onRemove()

Called right before the component is removed from the game.

Implementation

@override
@mustCallSuper
void onRemove() {
  super.onRemove();
  children.forEach((child) {
    child.onRemove();
  });
  isPrepared = false;
  isMounted = false;
  _parent = null;
  nextParent?.add(this);
  nextParent = null;
}