import { math } from "cc"; import { PhysicsSystem2D } from "cc"; import GRoleBase from "../role/GRoleBase"; import { Vec2 } from "cc"; //检测工具类 export default class GDetection{ //检测角色 static testAABBRole(rect:math.Rect):GRoleBase<{}>[]{ //@ts-ignore return PhysicsSystem2D.instance.testAABB(rect).map(item => item.getComponent(GRoleBase)); } //检测角色 static testPointRole(pos:Vec2){ //@ts-ignore console.log(PhysicsSystem2D.instance.testPoint(pos)); } }