新增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

@@ -1,6 +1,5 @@
abstract class Component {
public entity: Entity;
public displayRender: egret.DisplayObject;
private _enabled: boolean = true;
public updateInterval: number = 1;
@@ -56,13 +55,6 @@ abstract class Component {
}
/** 绑定显示对象 */
public bind(displayRender: egret.DisplayObject){
this.displayRender = displayRender;
return this;
}
/** 内部使用 运行时不应该调用 */
public registerComponent(){
this.entity.componentBits.set(ComponentTypeManager.getIndexFor(this), false);