findAncestor static method
Returns the nearest AudioEngine on node or an ancestor, or
null.
Implementation
static AudioEngine? findAncestor(Node node) {
for (Node? current = node; current != null; current = current.parent) {
final engine = current.getComponent<AudioEngine>();
if (engine != null) return engine;
}
return null;
}