@phaserjs/phaser
Version:
14 lines (13 loc) • 547 B
JavaScript
import { DepthFirstSearchFromParentID } from "./DepthFirstSearchFromParentID";
import { GameObjectWorld } from "../../GameObjectWorld";
import { GetWorldFromParentID } from "./GetWorldFromParentID";
import { SetWorldID } from "./SetWorldID";
import { removeComponent } from "bitecs";
export function RemoveWorldTag(id) {
const world = GetWorldFromParentID(id);
const children = DepthFirstSearchFromParentID(id, false);
children.map((childID) => {
removeComponent(GameObjectWorld, world.tag, childID);
SetWorldID(childID, 0);
});
}