123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using UnityEngine;
- using System.Collections;
- public class TestItween : MonoBehaviour
- {
- /// <summary>
- /// Use this for initialization
- /// </summary>
- void Start()
- {
- }
- /// <summary>
- ///
- /// </summary>
- private void TestItweenMove()
- {
- Hashtable ht = new Hashtable();
- ht.Add("y", 270);
- ht.Add("islocal", true);
- ht.Add("time", 1.0f);
- ht.Add("oncomplete", "OnDownAtkIcon");
- ht.Add("oncompletetarget", this.gameObject);
- ht.Add("oncompleteparams", this.gameObject.name);
- iTween.MoveTo(gameObject, ht);
- }
- /// <summary>
- /// 隐藏战斗图片
- /// </summary>
- private void OnDownAtkIcon(string parm)
- {
- Hashtable ht = new Hashtable();
- ht.Add("y", -50);
- ht.Add("islocal", true);
- ht.Add("time", 1.0f);
- ht.Add("oncomplete", "OnNormalAtkIcon");
- ht.Add("oncompletetarget", this.gameObject);
- ht.Add("oncompleteparams", this.gameObject.name);
- ht.Add("easetype", iTween.EaseType.linear);
- iTween.MoveTo(gameObject, ht);
- }
- /// <summary>
- /// 初始装提
- /// </summary>
- private void OnNormalAtkIcon(string parm)
- {
- LogHelper.LogError("over");
- //isAtkMove = false;
- }
- /// <summary>
- ///
- /// </summary>
- void OnGUI()
- {
- if (GUI.Button(new Rect(50, 250, 200, 30), "Button1"))
- {
- TestItweenMove();
- }
- }
- }
|