findCompNearest<C extends Comp<T> > method
C?
findCompNearest<C extends Comp<T> >()
inherited
Finds the closest component of type C via breadth-first search.
Implementation
C? findCompNearest<C extends Comp<T>>() {
// check self first
final self = get<C>();
if (self != null) return self;
// check parent chain
final inParent = findCompInParent<C>();
if (inParent != null) return inParent;
// check children
return findComp<C>();
}