按照文档的试了,也按照隔壁家的文档试了,好像并没什么卵用!求正确的姿势!!!
Vec3.copy(this._pos, this.node.position);
tweenUtil(this._pos)
.to(3, new Vec3(pos.x, 1.5, pos.z), { easing: ‘Bounce-InOut’ })
.union()
.call(this.finshCallBack, this)
.start();
这里还要把 _pos 设置到 node 的 position 属性中,可以利用 to 或者 by 的 onUpdate 可选属性,例如以下方式
to(3, new Vec3(pos.x, 1.5, pos.z), { easing: 'Bounce-InOut', onUpdate:()=>{this.node.position = this._pos;} })
另外这段代码中的 pos 不知道是哪里的,记得检查一下
那回调函数这个现在还不支持是吗?
支持 call,但是 call 目前只接受一个函数,需要自己绑定调用对象
我发现tween tweenUtil.by 不支持 移动 到负的距离 ,而且by 和to 的注释是反的。
可以给个 demo 吗,不太理解移动到负的距离是什么意思
还是不会用这个call,我选择绕道八十里路来实现……
updata 里面是不是也要把节点的position一起更新一下
by 里的向量vec3 填负数,位置 会乱掉。