Unity 3D之ITween函数介绍

private var go : GameObject;//需要动画的游戏物体
private var cam : GameObject;//镜头
function Awake(){
//赋值
go = gameObject;
cam = camera.main.gameObject;
}
function Start(){
iTween.rotateFrom(go,{"y":90, "time":1.5, "transition":"easeInExpo"});//旋转从90度到当前
iTween.moveFrom(go,{"y":3.5, "time":1.5, "transition":"easeInExpo"});//从y值3.5移动到当前
iTween.colorTo(go,{"r":3, "g":.5, "b":1.2, "time":.3, "delay":1.5});//颜色变化到新的值
iTween.shake(cam,{"y":.3, "time":.8, "delay":1.5});//每1.5s震动一次镜头物体
iTween.scaleTo(go,{"y":2, "time":2, "delay":2.3});//缩放到新比例
iTween.rotateBy(go,{"x":.5, "delay":4.3});//每4.3s旋转0.5度
iTween.moveTo(go,{"y":1.2, "delay":4.6});//移动到新位置
iTween.moveTo(go,{"y":0, "delay":5.8, "transition":"easeInExpo"});//同前解释
iTween.shake(cam,{"y":.3, "time":.8, "delay":6.8});//同前解释
iTween.colorTo(go,{"r":.165, "g":.498, "b":.729, "time":.5, "delay":7.6});//同前解释
iTween.scaleTo(go,{"y":1, "delay":7.6});//缩放到新比例
}


你可能感兴趣的:(Unity 3D之ITween函数介绍)