| 24 | hook; |
| 25 | component: StatsComponent; |
| 26 | init(param: StatsParams = { show: true }) { |
| 27 | this.show = param.show; |
| 28 | this.style = param.style; |
| 29 | this.renderSystem = this.game.getSystem('Renderer') as RendererSystem; |
| 30 | this.app = this.renderSystem.application; |
| 31 | if (this.app && this.show) { |
| 32 | // @ts-ignore |
| 33 | const gl = this.app.renderer.gl as WebGLRenderingContext; |
| 34 | this.hook = new BaseHooks(); |
| 35 | this.hook.attach(gl); |
| 36 | } |
| 37 | } |
| 38 | start() { |
| 39 | if (!this.show) return; |
| 40 | this.component = this.game.scene.addComponent(new StatsComponent()); |