1 using UnityEngine; 2 using System.Collections; 3 4 public class HelloiTween : MonoBehaviour { 5 6 Hashtable lht = new Hashtable(); 7 8 9 // Use this for initialization 10 void Start() 11 { 12 lht.Add("x",3); 13 lht.Add("time",2); 14 lht.Add("delay",1); 15 lht.Add("looptype",iTween.LoopType.pingPong); 16 } 17 18 // Update is called once per frame 19 void Update () { 20 21 if (Input.GetMouseButtonDown(0)) 22 { 23 iTween.MoveTo(this.gameObject, new Vector3(3, 3, 3), 5f); 24 iTween.RotateTo(this.gameObject, new Vector3(0, 222, 0), 5f); 25 } 26 if (Input.GetMouseButtonDown(1)) 27 { 28 iTween.MoveTo(this.gameObject, lht); 29 } 30 if (Input.GetMouseButtonDown(2)) 31 { 32 iTween.MoveTo(this.gameObject, iTween.Hash("x",3,"time",2,"delay",1,"looptype",iTween.LoopType.pingPong)); 33 } 34 } 35 }
时间: 2024-10-14 18:27:07