reformat code
This commit is contained in:
@@ -2,18 +2,18 @@ module es {
|
||||
export class Debug {
|
||||
private static _debugDrawItems: DebugDrawItem[] = [];
|
||||
|
||||
public static drawHollowRect(rectanle: Rectangle, color: number, duration = 0){
|
||||
public static drawHollowRect(rectanle: Rectangle, color: number, duration = 0) {
|
||||
this._debugDrawItems.push(new DebugDrawItem(rectanle, color, duration));
|
||||
}
|
||||
|
||||
public static render(){
|
||||
if (this._debugDrawItems.length > 0){
|
||||
public static render() {
|
||||
if (this._debugDrawItems.length > 0) {
|
||||
let debugShape = new egret.Shape();
|
||||
if (Core.scene){
|
||||
if (Core.scene) {
|
||||
Core.scene.addChild(debugShape);
|
||||
}
|
||||
|
||||
for (let i = this._debugDrawItems.length - 1; i >= 0; i --){
|
||||
for (let i = this._debugDrawItems.length - 1; i >= 0; i--) {
|
||||
let item = this._debugDrawItems[i];
|
||||
if (item.draw(debugShape))
|
||||
this._debugDrawItems.removeAt(i);
|
||||
|
||||
@@ -18,15 +18,15 @@ module es {
|
||||
public y: number;
|
||||
public size: number;
|
||||
|
||||
constructor(rectangle: Rectangle, color: number, duration: number){
|
||||
constructor(rectangle: Rectangle, color: number, duration: number) {
|
||||
this.rectangle = rectangle;
|
||||
this.color = color;
|
||||
this.duration = duration;
|
||||
this.drawType = DebugDrawType.hollowRectangle;
|
||||
}
|
||||
|
||||
public draw(shape: egret.Shape): boolean{
|
||||
switch (this.drawType){
|
||||
public draw(shape: egret.Shape): boolean {
|
||||
switch (this.drawType) {
|
||||
case DebugDrawType.line:
|
||||
DrawUtils.drawLine(shape, this.start, this.end, this.color);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user