@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
16 lines (15 loc) • 441 B
JavaScript
;
export class SceneLifeCycleController {
constructor(scene) {
this.scene = scene;
this._lifecycleOnAfterCreatedAllowed = true;
}
onAfterCreatedCallbackAllowed() {
return this.scene.loadingController.loaded() && this._lifecycleOnAfterCreatedAllowed;
}
onAfterCreatedPrevent(callback) {
this._lifecycleOnAfterCreatedAllowed = false;
callback();
this._lifecycleOnAfterCreatedAllowed = true;
}
}