新增renderableComponent 用于控制可渲染组件的基类 不要在transform当中直接更改目标属性

This commit is contained in:
yhh
2020-06-10 16:25:39 +08:00
parent 94818d5784
commit f62f449d99
12 changed files with 125 additions and 114 deletions

View File

@@ -98,14 +98,7 @@ class Camera extends Component {
}
public update(){
SceneManager.getActiveScene().entities.buffer.forEach(entity => entity.components.buffer.forEach(component => {
if (component.displayRender){
let has = this.entity.scene.$children.indexOf(component.displayRender)
if (has == -1){
this.entity.scene.stage.addChild(component.displayRender);
}
}
}));
}
public setPosition(position: Vector2){