Make SkinViewer.disposed readonly

This commit is contained in:
yushijinhun 2020-02-01 20:44:10 +08:00
parent 872f012e42
commit 42278ee509
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
1 changed files with 6 additions and 2 deletions

View File

@ -17,7 +17,6 @@ export class SkinViewer {
public readonly domElement: Node;
public readonly animations: RootAnimation = new RootAnimation();
public detectModel: boolean = true;
public disposed: boolean = false;
public readonly skinImg: HTMLImageElement;
public readonly skinCanvas: HTMLCanvasElement;
@ -33,6 +32,7 @@ export class SkinViewer {
public readonly playerObject: PlayerObject;
private _disposed: boolean = false;
private _renderPaused: boolean = false;
constructor(options: SkinViewerOptions) {
@ -126,13 +126,17 @@ export class SkinViewer {
}
dispose(): void {
this.disposed = true;
this._disposed = true;
this.domElement.removeChild(this.renderer.domElement);
this.renderer.dispose();
this.skinTexture.dispose();
this.capeTexture.dispose();
}
get disposed(): boolean {
return this._disposed;
}
get renderPaused(): boolean {
return this._renderPaused;
}