add method

  1. @override
void add(
  1. ShapeHitbox item
)
override

Implementation

@override
void add(ShapeHitbox item) {
  item.onAabbChanged = () => _scheduledUpdate.add(item);
  void listenerCollisionType() {
    if (item.isMounted) {
      if (item.collisionType == CollisionType.active) {
        broadphase.activeHitboxes.add(item);
      } else {
        broadphase.activeHitboxes.remove(item);
      }
    }
  }

  item.collisionTypeNotifier.addListener(listenerCollisionType);
  _listenerCollisionType[item] = listenerCollisionType;

  super.add(item);
}