usingUnityengine;
usingSystem.Collections;
Public class Movecube : Monobehaviour
{
Public Gameobject Targetgameobject;
Public float Time = 4f;
Public ITween.Easetype Easetype;
void Update ()
{
if (Input.Getmousebuttondown (0)) {
//ITween.MoveTo(Targetgameobject,New Vector3(4,4,0), Time);
// Hashtable args=New Hashtable();
// args.ADD("x",3);//control only the position of x the front is the key The following refers to
// args.ADD("y",5);
// args.ADD(" Time",4); //Exercise time 4 seconds
// args.ADD("Delay",1);//delay 1 seconds
// args.ADD("OnComplete","onupdatefunction");//Monitor MoveTo callback function
// args.ADD("Looptype","Pingpong");
Hashtable args = ITween.Hash ("x", 4, " Time", 2, "Easetype", Easetype);
ITween.MoveTo (Targetgameobject, args);
}
if (Input.Getmousebuttondown (1)) {
Hashtable args = ITween.Hash ("x", 0, " Time", 2, "Easetype", Easetype);
ITween.MoveTo (Targetgameobject, args);
}
}
Public void onupdatefunction ()
{
Print ("performed a");
}
}
This article is from the computer blog, so be sure to keep this source http://5152481.blog.51cto.com/5142481/1601430
ITween concept Learning, has been itween.moveto as an example