一、基础介绍
Value有一个函数
ValueTo:返回一个“from”和“to”之间的插值,以调用“onupdate”回调函数。“onupdate”是必须的,且它接收一个与“from”和“to”相同类型的参数。
支持的插值类型:float、double、Vector3、Vector2、Color、Rect。
二、基础属性
基础属性比较简单直接上代码
- void Start () {
-
- Hashtable args = new Hashtable();
-
- args.Add("from", 0.0f);
- args.Add("to", 1.0f);
-
-
-
-
- args.Add("time", 10f);
-
- args.Add("delay", 0.1f);
-
- args.Add("easeType", iTween.EaseType.easeInOutExpo);
-
-
-
- args.Add("loopType", iTween.LoopType.pingPong);
-
-
-
-
- args.Add("onstart", "AnimationStart");
- args.Add("onstartparams", 5.0f);
-
-
- args.Add("onstarttarget", gameObject);
-
-
- args.Add("oncomplete", "AnimationEnd");
- args.Add("oncompleteparams", "end");
- args.Add("oncompletetarget", gameObject);
-
-
- args.Add("onupdate", "AnimationUpdata");
- args.Add("onupdatetarget", gameObject);
-
-
- args.Add("onupdateparams", btnBegin);
-
- iTween.ValueTo(btnBegin, args);
- }
- public void AnimationUpdata(object obj)
- {
- float per = (float)obj;
-
- btnBegin.transform.FindChild("Background").GetComponent<UISprite>().alpha = per;
- }
-
-
- void AnimationStart(float f)
- {
- Debug.Log("start :" + f);
- }
-
- void AnimationEnd(string f)
- {
- Debug.Log("end : " + f);
- }