删除形状的绘制

This commit is contained in:
gongxh 2025-05-26 17:27:59 +08:00
parent 4269c88ff9
commit ca2d93b475
4 changed files with 3 additions and 26 deletions

View File

@ -4,7 +4,7 @@
* @Description:
*/
import { Graphics, Rect } from "cc";
import { Rect } from "cc";
import { Shape } from "./Shape";
export class Circle extends Shape {
@ -21,9 +21,4 @@ export class Circle extends Shape {
public getBoundingBox(): Rect {
return this.boundingBox;
}
/** @internal */
public drawShape(draw: Graphics): void {
draw && draw.circle(this.position.x, this.position.y, this.radius * this.scale);
}
}

View File

@ -4,7 +4,7 @@
* @Description:
*/
import { Graphics, Rect, v2, Vec2 } from "cc";
import { Rect, v2, Vec2 } from "cc";
import { Shape } from "./Shape";
@ -82,16 +82,4 @@ export class Polygon extends Shape {
this._realPoints[i] = v2(pts[i].x, pts[i].y);
}
}
/** @internal */
public drawShape(draw: Graphics): void {
if (draw) {
let points = this.points;
draw.moveTo(points[0].x, points[0].y);
for (let i = 1; i < points.length; i++) {
draw.lineTo(points[i].x, points[i].y);
}
draw.lineTo(points[0].x, points[0].y);
}
}
}

View File

@ -299,7 +299,6 @@ export class QuadTree {
this._trees[quadrant].insert(shapes.splice(i, 1)[0]);
}
}
shape.drawShape(this._graphics);
}
}
}

View File

@ -4,7 +4,7 @@
* @Description:
*/
import { Graphics, Rect, Vec2 } from "cc";
import { Rect, Vec2 } from "cc";
export abstract class Shape {
/**
@ -71,10 +71,5 @@ export abstract class Shape {
public destroy(): void {
this._valid = false;
}
/** @internal */
public drawShape(draw: Graphics): void {
}
}