using UnityEngine; using System.Collections; public class TestItween : MonoBehaviour { /// /// Use this for initialization /// void Start() { } /// /// /// 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); } /// /// 隐藏战斗图片 /// 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); } /// /// 初始装提 /// private void OnNormalAtkIcon(string parm) { LogHelper.LogError("over"); //isAtkMove = false; } /// /// /// void OnGUI() { if (GUI.Button(new Rect(50, 250, 200, 30), "Button1")) { TestItweenMove(); } } }