修复无graphics报错问题
This commit is contained in:
@@ -377,6 +377,7 @@ module es {
|
||||
}
|
||||
|
||||
public debugRender(batcher: IBatcher) {
|
||||
if (!batcher) return;
|
||||
this.components.debugRender(batcher);
|
||||
}
|
||||
|
||||
|
||||
@@ -327,6 +327,7 @@ module es {
|
||||
}
|
||||
|
||||
public debugRender(batcher: IBatcher) {
|
||||
if (!batcher) return;
|
||||
for (let i = 0; i < this._components.length; i ++) {
|
||||
if (this._components[i].enabled) {
|
||||
this._components[i].debugRender(batcher);
|
||||
|
||||
@@ -14,22 +14,34 @@ module es {
|
||||
public unload() { }
|
||||
|
||||
protected beginRender(cam: ICamera) {
|
||||
if (!Graphics.instance)
|
||||
return;
|
||||
|
||||
Graphics.instance.batcher.begin(cam);
|
||||
}
|
||||
|
||||
protected endRender() {
|
||||
if (!Graphics.instance)
|
||||
return;
|
||||
|
||||
Graphics.instance.batcher.end();
|
||||
}
|
||||
|
||||
public abstract render(scene: Scene): void;
|
||||
|
||||
protected renderAfterStateCheck(renderable: IRenderable, cam: ICamera) {
|
||||
if (!Graphics.instance)
|
||||
return;
|
||||
|
||||
renderable.render(Graphics.instance.batcher, cam);
|
||||
}
|
||||
|
||||
protected debugRender(scene: Scene) {
|
||||
es.Physics.debugDraw(2);
|
||||
if (!Graphics.instance)
|
||||
return;
|
||||
|
||||
es.Physics.debugDraw(2);
|
||||
|
||||
for (let i = 0; i < scene.entities.count; i ++) {
|
||||
let entity = scene.entities.buffer[i];
|
||||
if (entity.enabled) {
|
||||
|
||||
Reference in New Issue
Block a user