Skip to content

Instantly share code, notes, and snippets.

@NoxWings
Last active August 27, 2020 13:20
Show Gist options
  • Save NoxWings/92e1c3c273624bbf80dee32c1c7c1db8 to your computer and use it in GitHub Desktop.
Save NoxWings/92e1c3c273624bbf80dee32c1c7c1db8 to your computer and use it in GitHub Desktop.
Print PIXI tree hierarchy
function printHierarchy(node, padding="") {
let newPadding = padding;
if (node.name) {
newPadding += " |";
console.log(`${padding}-${node.name}`);
}
node.children.forEach(child => printHierarchy(child, newPadding));
}
printHierarchy(APP.safeGetChildByName(""));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment