新增renderableComponent 用于控制可渲染组件的基类 不要在transform当中直接更改目标属性
This commit is contained in:
@@ -203,14 +203,6 @@ class Transform {
|
||||
this.localScale = scale;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.entity.components.buffer.length; i ++){
|
||||
let component = this.entity.components.buffer[i];
|
||||
if (component.displayRender){
|
||||
component.displayRender.scaleX = this.scale.x;
|
||||
component.displayRender.scaleY = this.scale.y;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -234,13 +226,6 @@ class Transform {
|
||||
this.localRotation = radians;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.entity.components.buffer.length; i ++){
|
||||
let component = this.entity.components.buffer[i];
|
||||
if (component.displayRender){
|
||||
component.displayRender.rotation = this.rotation;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -270,14 +255,6 @@ class Transform {
|
||||
this.localPosition = position;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.entity.components.buffer.length; i ++){
|
||||
let component = this.entity.components.buffer[i];
|
||||
if (component.displayRender){
|
||||
component.displayRender.x = this.entity.scene.camera.transformMatrix.m31 + this.position.x;
|
||||
component.displayRender.y = this.entity.scene.camera.transformMatrix.m32 + this.position.y;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user