@phaserjs/phaser
Version:
7 lines (6 loc) • 328 B
JavaScript
import { DepthFirstSearchFromParentID } from "../components/hierarchy/DepthFirstSearchFromParentID";
import { GameObjectCache } from "../gameobjects/GameObjectCache";
export function DepthFirstSearch(parent) {
const children = DepthFirstSearchFromParentID(parent.id);
return children.map((id) => GameObjectCache.get(id));
}