build method
override
Declares this node's children and behavior.
Runs once on mount, and again on every rebuild.
super.build() is required, as skipping it drops whatever the superclass
declared.
Implementation
@override
void build() {
super.build();
cd = ancestors.whereType<CollisionDetectionNode>().firstOrNull;
if (strict && cd == null) {
throw StateError('ColliderNode requires a CollisionDetectionNode ancestor.');
}
cd?.register(this);
trash(() {
cd?.unregister(this);
cd = null;
_active.clear();
});
debugDraw((canvas) {
canvas.drawRect(shape.rect(), DEBUG_COLLIDER_PAINT);
});
}