fix: detroy method

This commit is contained in:
thinkinggis 2020-03-01 21:20:11 +08:00
parent e95b5941fe
commit 661ff69fb1
2 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,7 @@ import { ISceneService } from './ISceneService';
*/
@injectable()
export default class Scene extends EventEmitter implements ISceneService {
public destroyed: true;
public destroyed: boolean = false;
@inject(TYPES.SceneID)
private readonly id: string;
@ -205,7 +205,7 @@ export default class Scene extends EventEmitter implements ISceneService {
}
public async render() {
if (this.rendering && !this.destroyed) {
if (this.rendering && this.destroyed) {
return;
}
@ -214,7 +214,7 @@ export default class Scene extends EventEmitter implements ISceneService {
if (!this.inited) {
// 还未初始化完成需要等待
await this.initPromise;
if (this.destroy) {
if (this.destroyed) {
this.destroy();
}

View File

@ -22,7 +22,6 @@ export default class Column extends React.Component {
rotation: 134.9507,
}),
});
scene.destroy();
this.scene = scene;
fetch(
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json',