模拟itween官网上的Path-constrained Characters操作
来源:互联网 发布:淘宝ka是什么意思 编辑:程序博客网 时间:2024/06/05 08:54
iTween及iTweenPath的使用
新建一个空物体,在导入的iTweenPath插件中找到iTween Path脚本,挂到新建的空物体上:
Path Name:路径名,待会需要使用"path",iTweenPath.GetPath("前面的路径名");
Path Color:路径颜色
Path Count:路径长度
Node1为Paths路径的起点得x,y,z三个方向的值,即起点在三维场景中的位置。
C#脚本:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Paths : MonoBehaviour {
public float time;
bool PlayITween = true;
void Start () {
}
void Update () {
//按住空格键播放iTween动画,弹起后所有动画停止播放(这是因为ITween.pause()的括号中没有添加游戏对象,加了以后即可只控制该游戏对象上的动画播放)
using System.Collections.Generic;
using UnityEngine;
public class Paths : MonoBehaviour {
public float time;
bool PlayITween = true;
void Start () {
}
void Update () {
//按住空格键播放iTween动画,弹起后所有动画停止播放(这是因为ITween.pause()的括号中没有添加游戏对象,加了以后即可只控制该游戏对象上的动画播放)
if (Input.GetKey(KeyCode.Space))
{
if (PlayITween )
{
MoveToPath();
PlayITween = false;
}
iTween.Resume(gameObject);
}
else
{
iTween.Pause(gameObject);
}
//两种方式向hashtable中添加键值对
public void MoveToPath()
{
Hashtable hashone = new Hashtable {
{"path",iTweenPath.GetPath("Paths") },
{"time", time},
{"easetype",iTween.EaseType.linear},
{"looptype",iTween.LoopType.loop},
{"movetopath",true},
{"orienttopath", true }
};
iTween.MoveTo(gameObject, hashone);
//Hashtable hashOne = new Hashtable();
//hashOne.Add("path", iTweenPath.GetPath("Paths"));
//hashOne.Add("time", time);
//hashOne.Add("easeType", iTween.EaseType.linear);
//hashOne.Add("loopType", iTween.LoopType.loop);
//hashOne.Add("movetopath", true);
//hashOne.Add("orienttopath", true);
//iTween.MoveTo(gameObject, hashOne);
}
}
{
if (PlayITween )
{
MoveToPath();
PlayITween = false;
}
iTween.Resume(gameObject);
}
else
{
iTween.Pause(gameObject);
}
//两种方式向hashtable中添加键值对
public void MoveToPath()
{
Hashtable hashone = new Hashtable {
{"path",iTweenPath.GetPath("Paths") },
{"time", time},
{"easetype",iTween.EaseType.linear},
{"looptype",iTween.LoopType.loop},
{"movetopath",true},
{"orienttopath", true }
};
iTween.MoveTo(gameObject, hashone);
//Hashtable hashOne = new Hashtable();
//hashOne.Add("path", iTweenPath.GetPath("Paths"));
//hashOne.Add("time", time);
//hashOne.Add("easeType", iTween.EaseType.linear);
//hashOne.Add("loopType", iTween.LoopType.loop);
//hashOne.Add("movetopath", true);
//hashOne.Add("orienttopath", true);
//iTween.MoveTo(gameObject, hashOne);
}
}
阅读全文
0 0
- 模拟itween官网上的Path-constrained Characters操作
- itween path起始点问题
- hdu 1839 Delay Constrained Maximum Capacity Path
- hdu 1839 Delay Constrained Maximum Capacity Path
- HDU1839---Delay Constrained Maximum Capacity Path
- hdu 1839:Delay Constrained Maximum Capacity Path
- HDU 1839 Delay Constrained Maximum Capacity Path
- HDU 1839 Delay Constrained Maximum Capacity Path
- HDU 1839 Delay Constrained Maximum Capacity Path
- HDU-1839-Delay Constrained Maximum Capacity Path
- Delay Constrained Maximum Capacity Path HDU
- Delay Constrained Maximum Capacity Path HDU
- Itween之音频操作
- hibernate constrained属性的作用
- hibernate的constrained(约束)
- iTween的使用。
- unity3D iTween的使用
- unity3D iTween的使用
- Android studio自动创建drawable-xhdpi文件夹
- 常用的Linux命令
- mysql可视化管理工具sqlYog常使用功能
- 获取验证码倒计时操作
- stm32_016_配置stm32在SRAM中调试运行
- 模拟itween官网上的Path-constrained Characters操作
- 打Jar包部分类找不到问题
- javaOO总结
- JavaScript时间戳格式化转换
- Android JiaoZiVideoPlayer源码分析
- ios ffmpeg编译支持命令行的静态库文件
- 【python学习笔记】基础知识
- 数据库选型解读,分布式数据库带来的技术革命
- Redis常用命令