onBeginConcat(self: Collider2D, other: Collider2D, info: IPhysics2DContact) {
console.log("on begin");
}
onEndConcat(self: Collider2D, other: Collider2D, info: IPhysics2DContact) {
update(deltaTime: number): void {
// direction 一直没变
this.node.setScale(this.direction, 1);
}
console.log("on end");
}
尽管我的direction 没变但是这个代码会一直重复出发 begin 和 end
整死我了,开个demo把代码一个个删掉才发现是这个引起的。
新人求教在开发中如何能避免类似的问题,一些框架的隐性判断导致程序出现逻辑错误应该怎么去规避呢?