creator 3.6 tween 使用后节点TOUCH_END事件无法再次触发

onEnable() {

    this.gameManager=this.node.parent.getComponent(GameManager03);

    this.sprite = this.node.getComponentInChildren(Sprite);

    this.node.on(Input.EventType.TOUCH_END, this.press, this);

}

onDisable() {

    this.node.off(Input.EventType.TOUCH_END, this.press, this);

}

press(e: EventTouch) {

    console.log(this.isDoing)

    if (this.isDoing) return;

    console.log('press')

    this.onPress();

}

onPress()

{

    this.isDoing = true;

    let quat: Quat = new Quat();

    Quat.fromEuler(quat, 0, 90, 0);

    let quat2: Quat = new Quat();

    Quat.fromEuler(quat2, 0, 0, 0);

    let t1 = new Tween(this.node)

        .to(this.time, { rotation: quat , scale: new Vec3(0.9, 0.9) }).call(() => {

        console.log('half')

        this.changeSprite();

    })

    .to(this.time, { rotation: quat2,scale: new Vec3(1, 1) }).call(() => {

        console.log('done')

        this.font = !this.font;

        this.canMatch = true;

    })

    .delay(2.0).call(()=>{

        this.canMatch = false;

    })

    .to(this.time, { rotation: quat,scale: new Vec3(0.9, 0.9) })

    .call(() => {

        console.log('half2')

        this.changeSprite();

    })

    .to(this.time, { rotation: quat2,scale: new Vec3(1, 1)  }).call(() => {

        console.log('done2')

        this.isDoing = false;

    }).start();

       

}

当前节点增加了tween动作后,第一次触发后,无法再次触发事件,很奇怪的问题。

scale 改下,new Vec3(1,1,1). :sweat_smile:

1赞

好了,高人,哈哈。多谢

多年后,遇到同样的问题,感谢。z轴没了,看不出来,查了一天 :joy: