onRemove method

void onRemove()

Called right before the component is removed from the game.

This method will only run for a component that was previously mounted into a component tree. If a component was never mounted (for example, when it is removed before it had a chance to mount), then this callback will not trigger. Thus, onRemove runs if and only if there was a corresponding onMount call before.

Implementation

void onRemove() {}