addChild method

void addChild(
  1. ActorComponent component
)

Implementation

void addChild(ActorComponent component) {
  if (component.parent != null) {
    component.parent!.removeChild(component);
  }
  component.parent = this;
  _children ??= <ActorComponent>[];
  _children!.add(component);
}