Skip to content

Commit

Permalink
feat: cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Piętal committed May 22, 2024
1 parent cf381d9 commit 7676ea5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/game-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class GameObject extends lifecycle_1.Lifecycle {
}
});
// add pixi components
(_a = (0, exports.getRoot)(this)) === null || _a === void 0 ? void 0 : _a.stageAddChild(...children);
(_a = this.scene) === null || _a === void 0 ? void 0 : _a.stageAddChild(...children);
}
removeChild(...children) {
var _a;
Expand All @@ -81,7 +81,7 @@ class GameObject extends lifecycle_1.Lifecycle {
}
});
// remove pixi components
(_a = (0, exports.getRoot)(this)) === null || _a === void 0 ? void 0 : _a.stageRemoveChild(...children);
(_a = this.scene) === null || _a === void 0 ? void 0 : _a.stageRemoveChild(...children);
}
getChildOfType(type) {
return this.children.find(({ label }) => label === type);
Expand Down
4 changes: 2 additions & 2 deletions docs/demo/demo.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -88578,7 +88578,7 @@ Deprecated since v${version}`
}
});
// add pixi components
(_a = (0, exports.getRoot)(this)) === null || _a === void 0
(_a = this.scene) === null || _a === void 0
? void 0
: _a.stageAddChild(...children);
}
Expand All @@ -88592,7 +88592,7 @@ Deprecated since v${version}`
}
});
// remove pixi components
(_a = (0, exports.getRoot)(this)) === null || _a === void 0
(_a = this.scene) === null || _a === void 0
? void 0
: _a.stageRemoveChild(...children);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jacekpietal/oneforall",
"description": "One For All - TypeScript gamedev library inspired by Unity",
"version": "8.0.1",
"version": "8.0.2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/game-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class GameObject extends Lifecycle {
}
});
// add pixi components
getRoot(this)?.stageAddChild(...children);
this.scene?.stageAddChild(...children);
}

removeChild(...children: LifecycleProps[]): void {
Expand All @@ -125,7 +125,7 @@ export class GameObject extends Lifecycle {
}
});
// remove pixi components
getRoot(this)?.stageRemoveChild(...children);
this.scene?.stageRemoveChild(...children);
}

getChildOfType(type: string): LifecycleProps {
Expand Down

0 comments on commit 7676ea5

Please sign in to comment.