[]3D模型无法用Tween类吗
//载入并显示模型
var layaMonkey: Laya.Sprite3D =Laya.Sprite3D.load("LayaMonkey/LayaMonkey.lh") as Laya.Sprite3D;
scene.addChild(layaMonkey);
layaMonkey.transform.localScale = new Laya.Vector3(0.001,0.001,0.001);
layaMonkey.transform.localPosition = new Laya.Vector3(0,1,0);
layaMonkey.transform.rotate(new Laya.Vector3(0,-Math.PI/2,0));
//移动模型
Laya.Tween.to(layaMonkey,{x:0,y:-1,z:-3},5000,Laya.Ease.linearIn);
)
我看也没写错 是这个类不适用3D模型吗
var layaMonkey: Laya.Sprite3D =Laya.Sprite3D.load("LayaMonkey/LayaMonkey.lh") as Laya.Sprite3D;
scene.addChild(layaMonkey);
layaMonkey.transform.localScale = new Laya.Vector3(0.001,0.001,0.001);
layaMonkey.transform.localPosition = new Laya.Vector3(0,1,0);
layaMonkey.transform.rotate(new Laya.Vector3(0,-Math.PI/2,0));
//移动模型
Laya.Tween.to(layaMonkey,{x:0,y:-1,z:-3},5000,Laya.Ease.linearIn);
)
我看也没写错 是这个类不适用3D模型吗
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
Aar0n
赞同来自:
kezhiyu
赞同来自:
给你一个链接,自己用吧,https://github.com/sole/tween.js
zszen
赞同来自:
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);
无法直接设置原因是浅拷贝变量无法同步到原对象中去