componentCount property
int
get
componentCount
How many components it holds, removed ones among them until the world tidies them away: read them with componentAt, which, unlike GameObject.getAll, makes no list.
Implementation
int get componentCount => _components?.length ?? 0;