cc.tween 可以在执行事件的过程中插入事件吗?怎么做?

cc.tween 可以在执行事件的过程中插入事件吗?怎么做?

求大佬们解答

onUpdate的ratio?

自定义 progress

自定义 progress 函数可以更自由的控制缓动的过程。

// 对所有属性自定义 progress
cc.tween().to(1, { scale: 2, rotation: 90 }, {
  progress: (start, end, current, ratio) => {
    return start + (end - start) * ratio;
  }
})

// 对单个属性自定义 progress
cc.tween().to(1, {
  scale: 2,
  position: {
    value: cc.v3(),
    progress: (start, end, current, t) => {
      // 注意,传入的属性为 cc.Vec3,所以需要使用 Vec3.lerp 进行插值计算
      return start.lerp(end, t, current);
    }
  }
})
2赞

这个只能控制某一个过程,我想能不能像出入栈那样,不断增加事件队列,用于主要帧同步插值

鸦哥!dddd!