UNPKG

polygonjs-engine

Version:

node-based webgl 3D engine https://polygonjs.com

15 lines (14 loc) 394 B
export class LifeCycleController { constructor(scene) { this.scene = scene; this._lifecycle_on_create_allowed = true; } onCreateHookAllowed() { return this.scene.loadingController.loaded() && this._lifecycle_on_create_allowed; } onCreatePrevent(callback) { this._lifecycle_on_create_allowed = false; callback(); this._lifecycle_on_create_allowed = true; } }