using UnityEngine;
using System.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);//只控制X的位置 前面是键 后面是指
// args.Add("y",5);
// args.Add("time",4); //运动时间4秒
// args.Add("delay",1);//延迟1秒
// args.Add("oncomplete","onupdatefunction");//监测MOVETO回调函数
// 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 ("执行了");
}
}