ITween的概念学习,已 iTween.MoveTo为例
usingUnityEngine;
usingSystem.Collections;
publicclassMoveCube:MonoBehaviour
{
publicGameObjecttargetGameObject;
publicfloattime=4f;
publiciTween.EaseTypeeaseType;
voidUpdate()
{
if(Input.GetMouseButtonDown(0)){
//iTween.MoveTo(targetGameObject,newVector3(4,4,0),time);
//Hashtableargs=newHashtable();
//args.Add("x",3);//只控制X的位置前面是键后面是指
//args.Add("y",5);
//args.Add("time",4);//运动时间4秒
//args.Add("delay",1);//延迟1秒
//args.Add("oncomplete","onupdatefunction");//监测MOVETO回调函数
//args.Add("looptype","pingpong");
Hashtableargs=iTween.Hash("x",4,"time",2,"easeType",easeType);
iTween.MoveTo(targetGameObject,args);
}
if(Input.GetMouseButtonDown(1)){
Hashtableargs=iTween.Hash("x",0,"time",2,"easeType",easeType);
iTween.MoveTo(targetGameObject,args);
}
}
publicvoidonupdatefunction()
{
print("执行了");
}
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。