[]Laya.Tween怎么运用到3D对象上?
解决了,无法删除问题,所以更新一下。
------------------------
在社区搜索了一下,都是说要set一下。感觉说的很不清楚,
让人以为从字面上看set是一个属性,或者更改transform。我设置了都不行。
结果看示例,在很不起眼的地方发现一个loop函数一直在修改定位才能用Tween...
------------------------
在社区搜索了一下,都是说要set一下。感觉说的很不清楚,
让人以为从字面上看set是一个属性,或者更改transform。我设置了都不行。
结果看示例,在很不起眼的地方发现一个loop函数一直在修改定位才能用Tween...
厉害~\(≧▽≦)/~
不用删,可以留着让其他开发者借鉴
不用删,可以留着让其他开发者借鉴
box.potOld = box.transform.position;Laya.Tween.to(box.potOld,{
x:1
,y:2
,update:new Laya.Handler(box,function(){
this.transform.position = this.potOld;
})
}, ConstValue.animationTime,Laya.Ease.elasticOut,Laya.Handler.create(this, function(){
console.log("complete");
}),ConstValue.animationDelay);
无法直接设置原因是浅拷贝变量无法同步到原对象中去
x:1
,y:2
,update:new Laya.Handler(box,function(){
this.transform.position = this.potOld;
})
}, ConstValue.animationTime,Laya.Ease.elasticOut,Laya.Handler.create(this, function(){
console.log("complete");
}),ConstValue.animationDelay);
无法直接设置原因是浅拷贝变量无法同步到原对象中去
Laya.Tween.to(this.box.transform, {
localPositionX : this.box.transform.localPositionX + 8,
localPositionZ : this.box.transform.localPositionZ + 4,
}, 500);
用这种方式就可以了
localPositionX : this.box.transform.localPositionX + 8,
localPositionZ : this.box.transform.localPositionZ + 4,
}, 500);
用这种方式就可以了
要回复问题请先登录