一、基础介绍
RotateTo:旋转游戏物体到指定的角度。
RotateFrom:将游戏物体从给的角度旋转回原始角度
RotateAdd:对游戏物体的旋转角度随着时间,增加所提供的角度。
RotateBy:将提供的值乘以360,其余与RotateAdd相同。也就是提供的值为每个轴上旋转的周数.
RotateUpdate:类似于RotateTo
,在Update()方法或循环环境中调用。提供每帧改变属性值的环境。不依赖于EasrType.
二、基础属性
基础属性比较简单直接上代码
- void Start () {
-
-
- Hashtable args = new Hashtable();
-
-
- args.Add("rotation", new Vector3(1, 100, 1));
-
-
- args.Add("x", 100);
- args.Add("y", 1);
- args.Add("z", 1);
-
-
- args.Add("islocal", true);
-
-
-
- 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", "AnimationUpdate");
- args.Add("onupdatetarget", gameObject);
- args.Add("onupdateparams", true);
-
- iTween.RotateTo(btnBegin, args);
- }
-
-
-
- void AnimationStart(float f)
- {
- Debug.Log("start :" + f);
- }
-
- void AnimationEnd(string f)
- {
- Debug.Log("end : " + f);
- }
-
- void AnimationUpdate(bool f)
- {
- Debug.Log("update :" + f);
- }