码迷,mamicode.com
首页 > 其他好文 > 详细

iTween的简单用法

时间:2016-02-01 02:10:43      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:

iTween的简单用法

 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 }

iTween的简单用法

标签:

原文地址:http://www.cnblogs.com/GGman/p/5174175.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!