Simple Waypoint System的使用与其动画录制
Simple Waypoint System的使用与其动画录制*
simple waypoint system
的使用教程链接https://blog.csdn.net/qq_34937637/article/details/82835667
网盘的下载地址:链接:
https://pan.baidu.com/s/1jOJ8wutDG8rAPu1C3ai5TA
提取码:hja0
注意的是 这个插件最后好用unity2018版本的
关于动画的录制
注意一点 GameObjectRecorder只有在uniy2018中能引用到,所以最好用unity2018版本的
具体步骤:
**创建GameObjectRecorder类型的实例。
调用GameObjectRecorder实例的方法 BindComponentOfType(GameObject , )绑定需要录制的组件,然后调用TakeSnapshot(Time.deltaTime),进行录制。这里要注意GameObject参数是录制Clip的根节点,如果要录制的动画层级很多,一定要把这个参数设为根节点。不然录制的Clip层级不对。
调用GameObjectRecorder实例的方法SaveToClip(AnimationClip),把绑定的帧存储在Clip中。
代码如下:
(GameObjectRecorder)需要用到unity2018
using UnityEngine;
using UnityEditor.Animations;
public class RecordTransformHierarchy : MonoBehaviour
{public AnimationClip clip;private GameObjectRecorder m_Recorder;void Start(){// Create recorder and record the script GameObject.m_Recorder = new GameObjectRecorder(gameObject);// Bind all the Transforms on the GameObject and all its children.//这里的Bind操作,可以绑定各种UnityEngine的类型,比如MeshRender之类,//绑定之后就可以记录这个类型的值了。这里参数还需要注意,gameObject是Root节点,//如果要录制的物体有很多层级的话,最好参数设置为根节点。不然层级信息不对在Clip中无法播放。m_Recorder.BindComponentsOfType<Transform>(gameObject, true);}void LateUpdate(){if (clip == null)return;// Take a snapshot and record all the bindings values for this frame.m_Recorder.TakeSnapshot(Time.deltaTime);}void OnDisable(){if (clip == null)return;if (m_Recorder.isRecording){// Save the recorded session to the clip.m_Recorder.SaveToClip(clip);}}
}**`在这里插入代码片`
准备好代码之后,可以把代码直接绑定到要录
制的物体上,然后Play。之后就可以录制物体的动画文件了。。
对于这段代码,我做了一些调整 按下W时进行录制 按下Q时停止录制动画
代码为
**using UnityEngine;
using UnityEditor.Animations;
public class RecordTransformHierarchy : MonoBehaviour
{public AnimationClip clip;private float time;private GameObjectRecorder m_Recorder;void Start(){// Create recorder and record the script GameObject.m_Recorder = new GameObjectRecorder(gameObject);// Bind all the Transforms on the GameObject and all its children.//这里的Bind操作,可以绑定各种UnityEngine的类型,比如MeshRender之类,//绑定之后就可以记录这个类型的值了。这里参数还需要注意,gameObject是Root节点,//如果要录制的物体有很多层级的话,最好参数设置为根节点。不然层级信息不对在Clip中无法播放。m_Recorder.BindComponentsOfType<Transform>(gameObject, true);}void LateUpdate(){if (clip == null)return;if (Input.GetKey(KeyCode.W)){time = Time.deltaTime;Debug.Log("开始");}if (Input.GetKey(KeyCode.Q)) {Debug.Log("结束");OnEnd();}m_Recorder.TakeSnapshot(time);}void OnEnd(){if (clip == null)return;if (m_Recorder.isRecording){// Save the recorded session to the clip.m_Recorder.SaveToClip(clip);}}
}**
最后我将Simple Waypoint System和录制的功能统一打了一个包 ,可以下载
链接
:https://pan.baidu.com/s/1m3Xq0LPriATE9DSDWfZaXA
提取码:wyba
Simple Waypoint System的使用与其动画录制相关推荐
- unity20——寻路插件sws(simple waypoint system)
先上插件获取方式: 链接:https://pan.baidu.com/s/18_BOjPhNVIyqJjos5pnddQ 提取码:ceod 1. Simple Waypoint System(SWS) ...
- 【Unity3d】Simple Waypoint System插件
1.Simple Waypoint System(SWS)是基于Dotween的一款路径动画插件,Dotween想必大家比较熟悉,是一款很好用的动画插件,SWS在Dotween的基础上实现了可编辑路径 ...
- 【Unity3d】Simple Waypoint System插件介绍
Simple Waypoint System(SWS)是基于Dotween的一款路径动画插件,Dotween想必大家比较熟悉,是一款很好用的动画插件,SWS在Dotween的基础上实现了可编辑路径,并 ...
- 怎样写一个简单的操作系统?(原文标题:How to write a simple operating system) 分类: 翻译 2011-01-26 01:10 3175人阅读 评论(3) 收藏
怎样写一个简单的操作系统?(原文标题:How to write a simple operating system) 分类: 翻译2011-01-26 01:10 3175人阅读 评论(3) 收藏 举 ...
- 2022 *CTF REVERSE的Simple File System
2022 *CTF REVERSE的Simple File System . . 下载附件,有四个文件: . . 照例扔入虚拟机中运行一下,查看主要回显信息: . . 照例扔入 IDA64 中查看伪代 ...
- GifCam – 更好用的 gif 动画录制/剪辑工具
http://www.appinn.com/gifcam/ 同类型软件:GGG, LICEcap, ViewletCam GifCam 是款集录制与剪辑为一体的屏幕 GIF 动画制作工具,录制后的动画 ...
- Simple File System
This is my operating system class design. 1.一段代码及其bug. class Program{static void Main(string[] args) ...
- simple craft system
link https://assetstore.unity.com/packages/templates/systems/simple-craft-system-107967 --key points ...
- 022 - cocos creator 3D
#cocos creator 3D warning 报错:"project:///assets/main.js,将https中的export注视掉重试一遍 知识点 scrollview组件添 ...
最新文章
- 逆矩阵、伪逆矩阵:数据的压缩和复原
- windows CMD窗口换个标题 title命令
- Skywalking-01:Skywalking介绍
- 计算机基础(一):ION IOMMU 内存申请
- Selenium 脚本稳定性问题
- 深入了解现场服务软件的投资回报率(ROI)
- PyTorch深度学习(B站刘二大爷)第八讲作业——Kaggle网站泰坦尼克号Titanic
- OSChina 周三乱弹 —— 念念不忘,必有回响
- 2.19 serenity
- bomb和mysql,Bmob
- 基因-高通量测序-变异检测
- 云服务器免费suse系统,suse系统
- 计算机组成原理-第三章-存储系统
- 虚拟机怎么安装geany_75 个最常用的 Linux 应用程序(2018 年)
- Jira Sprit冲刺更改开始日期时出现 “18/Oct/21 10:38 AM”不是有效日期。请按下列格式输入日期:dd/MMM/yy h:mm a错误
- 千年之恋HTML5和CSS3
- 水下自动循迹机器人_循迹机器人
- 无代码自定义搭建业务系统选轻流
- 每日安全简讯20160728
- 第 5-5 课: 如何打包部署 Spring Boot 项⽬