UNITY之iTween
来源:互联网 发布:二叉树中序非递归算法 编辑:程序博客网 时间:2024/05/16 04:14
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour {
public Texture2D textsure;
public Vector3[] vecs;
// Use this for initialization
void Start () {
//iTween.MoveTo (this.gameObject,Vector3.up*5,3);
//iTween.MoveTo (this.gameObject,iTween.Hash("time",5,"x",10,"looptype",iTween.LoopType.pingPong,"oncomplete","OnAnimationComplete"));
Hashtable hash = new Hashtable ();
hash.Add ("time",5);
hash.Add ("x",10);
hash.Add ("looptype",iTween.LoopType.pingPong);
hash.Add ("oncomplete","OnAnimationComplete");
hash.Add ("easetype",iTween.EaseType.easeInExpo);
//hash.Add ("oncompleteparams","nihao");给OnAnimationComplete(string msg)方法传递参数
iTween.MoveTo (this.gameObject,hash);
//iTween.ColorTo (this.gameObject,iTween.Hash("r",0,"g",255,"b",0,"includechildren",true));//从原来颜色变换为目标颜色
//iTween.ColorFrom (this.gameObject,Color.black,3);//从此颜色变换回原来颜色
//iTween.CameraFadeAdd (textsure);//必须添加一张2d纹理
//iTween.CameraFadeFrom (1,3);//摄像机的透明度从1到0
//iTween.CameraFadeTo (1,3);//摄像机的透明度从0到1
//iTween.ScaleTo (this.gameObject,iTween.Hash("time",3,"x",5));
//iTween.PunchPosition (this.gameObject,iTween.Hash("time",2,"x",2,"y",2));
//iTween.ShakePosition (this.gameObject,iTween.Hash("time",5,"x",2,"y",2));
}
void OnDrawGizmos(){
iTween.DrawLine (vecs,Color.red);//绘制一条线链接Vector3[] vecs中的各点;
//iTween.DrawPath (vecs,Color.red);//绘制一条路径链接Vector3[] vecs中的各点
}
// Update is called once per frame
void Update () {
//iTween.MoveUpdate (this.gameObject,Vector3.up*Time.deltaTime,2);
}
void OnAnimationComplete(){
print ("nihao OnAnimationComplete");
}
// void OnAnimationComplete(string msg){
// print (msg);
// }
using System.Collections;
public class Move : MonoBehaviour {
public Texture2D textsure;
public Vector3[] vecs;
// Use this for initialization
void Start () {
//iTween.MoveTo (this.gameObject,Vector3.up*5,3);
//iTween.MoveTo (this.gameObject,iTween.Hash("time",5,"x",10,"looptype",iTween.LoopType.pingPong,"oncomplete","OnAnimationComplete"));
Hashtable hash = new Hashtable ();
hash.Add ("time",5);
hash.Add ("x",10);
hash.Add ("looptype",iTween.LoopType.pingPong);
hash.Add ("oncomplete","OnAnimationComplete");
hash.Add ("easetype",iTween.EaseType.easeInExpo);
//hash.Add ("oncompleteparams","nihao");给OnAnimationComplete(string msg)方法传递参数
iTween.MoveTo (this.gameObject,hash);
//iTween.ColorTo (this.gameObject,iTween.Hash("r",0,"g",255,"b",0,"includechildren",true));//从原来颜色变换为目标颜色
//iTween.ColorFrom (this.gameObject,Color.black,3);//从此颜色变换回原来颜色
//iTween.CameraFadeAdd (textsure);//必须添加一张2d纹理
//iTween.CameraFadeFrom (1,3);//摄像机的透明度从1到0
//iTween.CameraFadeTo (1,3);//摄像机的透明度从0到1
//iTween.ScaleTo (this.gameObject,iTween.Hash("time",3,"x",5));
//iTween.PunchPosition (this.gameObject,iTween.Hash("time",2,"x",2,"y",2));
//iTween.ShakePosition (this.gameObject,iTween.Hash("time",5,"x",2,"y",2));
}
void OnDrawGizmos(){
iTween.DrawLine (vecs,Color.red);//绘制一条线链接Vector3[] vecs中的各点;
//iTween.DrawPath (vecs,Color.red);//绘制一条路径链接Vector3[] vecs中的各点
}
// Update is called once per frame
void Update () {
//iTween.MoveUpdate (this.gameObject,Vector3.up*Time.deltaTime,2);
}
void OnAnimationComplete(){
print ("nihao OnAnimationComplete");
}
// void OnAnimationComplete(string msg){
// print (msg);
// }
}
using UnityEngine;
using System.Collections;
public class RotateDemo : MonoBehaviour {
public GameObject target;
// Use this for initialization
void Start () {
//looktarget:朝向的目标物体,path:运行轨道
iTween.MoveTo (this.gameObject,iTween.Hash("time",10,"looktarget",target.transform,"path",iTweenPath.GetPath("New Path 1"),
"oncomplete","method","easetype",iTween.EaseType.easeInExpo
));
}
// Update is called once per frame
void Update () {
}
void method(){//主要用来对摄像机的复原
}
}
0 0
- UNITY之iTween
- Unity 3D之ITween函数介绍
- Unity之iTween插件初探Move移动
- Unity Asset(5)iTween
- Unity初识iTween
- Unity 使用 iTween
- Unity Itween插件
- unity 插件 iTween简单用法
- unity的itween基础使用
- [Unity-3] iTween动画插件
- unity鼠标跟随(ITween)
- unity 插件 iTween简单用法
- Unity3D之iTween
- iTween基础之Rotate
- Itween之音频操作
- Unity动画库插件iTween介绍
- Unity动画库插件iTween介绍
- unity中用itween做展示效果
- 关于 RxJava
- redis
- day09内部类
- 怎么解析Json数据,然后把解析到的Json数据填充到布局中?
- 一些需要准备的东西
- UNITY之iTween
- 斯坦福大学深度学习与自然语言处理
- 位运算在Android Flag中的巧妙使用
- 【NOIP 模拟题】旅行(最短路)
- tjut 4287
- 1026 程序运行时间
- javascript的一个简单语法,记录下来
- 问题七 上下机
- 互联网-手机圈那些事