碰撞系统重做
This commit is contained in:
@@ -24,15 +24,13 @@ export class SkillCom extends CCComp {
|
||||
angle:number = 0;
|
||||
t_pos:Vec3 = null;
|
||||
is_destroy:boolean = false;
|
||||
box_group:number = 0;
|
||||
start() {
|
||||
this.node.active=true
|
||||
this.node.angle = this.angle;
|
||||
//根据目标坐标、欧拉角、预设距离增量speed 来计算新的x增量,y增量
|
||||
// this.x_speed = Math.cos(this.angle * Math.PI / 180) * this.speed;
|
||||
// this.y_speed = Math.sin(this.angle * Math.PI / 180) * this.speed;
|
||||
|
||||
|
||||
let collider = this.getComponent(Collider2D);
|
||||
collider.group = this.box_group;
|
||||
if (collider) {
|
||||
// collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
|
||||
@@ -86,11 +84,7 @@ export class SkillCom extends CCComp {
|
||||
|
||||
}
|
||||
|
||||
change_collider_group(group:number){
|
||||
let collider = this.getComponent(Collider2D);
|
||||
collider.group = group;
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
update(deltaTime: number) {
|
||||
// this.node.setScale(v3(this.scale,this.node.scale.y,this.node.scale.z))
|
||||
this.move(deltaTime)
|
||||
// if(Math.abs(this.node.position.x) > this.dis)
|
||||
|
||||
Reference in New Issue
Block a user