fozmo-3d-preview
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -10,4 +10,6 @@ import * as THREE from 'three'; | ||
private _renderer; | ||
protected container: HTMLElement; | ||
constructor(renderer: THREE.WebGLRenderer); | ||
update(): void; | ||
dispose(): void; | ||
} |
import Stats from 'three/examples/jsm/libs/stats.module'; | ||
import { BPGameConfig } from '../BPGameConfig'; | ||
export class BaseStats { | ||
@@ -10,2 +11,3 @@ _stats; | ||
_renderer; | ||
container; | ||
constructor(renderer) { | ||
@@ -18,3 +20,5 @@ this._stats = new Stats(); | ||
this._geometriesPanel = this._stats.addPanel(new Stats.Panel('Geometries', '#0ff', '#002')); | ||
window.document.body.appendChild(this._stats.dom); | ||
const container = document.getElementById(BPGameConfig.ElementId); | ||
container.appendChild(this._stats.dom); | ||
this.container = container; | ||
this._renderer = renderer; | ||
@@ -31,2 +35,8 @@ } | ||
} | ||
dispose() { | ||
if (this._stats) { | ||
this.container.removeChild(this._stats.dom); | ||
this._stats = null; | ||
} | ||
} | ||
} |
@@ -13,2 +13,3 @@ import { MainScene } from '../scenes/MainScene'; | ||
private _scenes; | ||
private _state; | ||
private constructor(); | ||
@@ -15,0 +16,0 @@ private onResize; |
@@ -22,2 +22,3 @@ import { MainScene } from '../scenes/MainScene'; | ||
_scenes = []; | ||
_state; | ||
constructor() { | ||
@@ -64,2 +65,3 @@ if (Utils.isiOSWechatEnv()) { | ||
this._mainScene.addUpdate(state.update, state); | ||
this._state = state; | ||
} | ||
@@ -95,3 +97,7 @@ } | ||
} | ||
if (this._state) { | ||
this._state.dispose(); | ||
this._state = null; | ||
} | ||
} | ||
} |
@@ -20,2 +20,3 @@ import { BaseScene, BaseSceneConfig } from '../Base/BaseScene'; | ||
private _dirLightHelper; | ||
private _gui; | ||
constructor(elementId?: string, config?: Partial<BaseSceneConfig>); | ||
@@ -22,0 +23,0 @@ init(url: string): Promise<boolean>; |
@@ -125,2 +125,3 @@ import { EEncryptExt, ENormalExt, ResLoaderManager } from './../manager/ResLoaderManager'; | ||
_dirLightHelper; | ||
_gui; | ||
constructor(elementId = 'game', config = {}) { | ||
@@ -278,2 +279,3 @@ super(elementId, config); | ||
gui.open(); | ||
this._gui = gui; | ||
} | ||
@@ -572,4 +574,8 @@ updateGUI(folder) { | ||
} | ||
if (this._gui) { | ||
this._gui.destroy(); | ||
this._gui = null; | ||
} | ||
super.destroy(); | ||
} | ||
} |
{ | ||
"name": "fozmo-3d-preview", | ||
"version": "1.0.06", | ||
"version": "1.0.07", | ||
"description": "风之末 作品预览", | ||
@@ -5,0 +5,0 @@ "main": "lib/Fozmo3DPreview.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
152450
4716