新增基础实体系统

This commit is contained in:
yhh
2020-06-08 18:26:05 +08:00
parent 7939253622
commit 57efc5b0e6
18 changed files with 551 additions and 28 deletions

View File

@@ -1,11 +1,27 @@
abstract class Component {
public entity: Entity;
public displayRender: egret.DisplayObject;
private _enabled: boolean = true;
public get enabled(){
return this.entity ? this.entity.enabled && this._enabled : this._enabled;
}
public set enabled(value: boolean){
this.setEnabled(value);
}
public setEnabled(isEnabled: boolean){
if (this._enabled != isEnabled){
this._enabled = isEnabled;
}
return this;
}
public abstract initialize();
public update(){
}
/** 绑定显示对象 */