接单做网站怎么开价格,汕尾百度seo公司,怎样下载模板做网站,做产品的往这看 国外工业设计网站大全利用Unity 自带的Timeline 可轻松实现场景的巡检漫游效果#xff0c; 基本使用参考以下链接: Unity中的Timeline Unity学习笔记——TimeLine的简单使用方法#xff08;一#xff09;
这里主要介绍如何通过滑动条控制播放的进度#xff0c;效果图附上。 话不多说#xff…利用Unity 自带的Timeline 可轻松实现场景的巡检漫游效果 基本使用参考以下链接: Unity中的Timeline Unity学习笔记——TimeLine的简单使用方法一
这里主要介绍如何通过滑动条控制播放的进度效果图附上。 话不多说直接上干货 public GameObject TimeLine_ZCF; public Slider TimeLine_ZXS_Slider;void Start(){//给滑动条添加方法值改变时触发更改TimeLine的time值TimeLine_ZXS_Slider.onValueChanged.AddListener((float value) { TimeLine_ZXS.GetComponentPlayableDirector().time value * TimeLine_ZXS.GetComponentPlayableDirector().duration; });}//控制漫游启停void ConTrolManYou(bool isStart){if(isStart){TimeLine.GetComponentPlayableDirector().Play();InvokeRepeating(DelayedExeCuteSlider, 0f, 1f);}else{TimeLine.GetComponentPlayableDirector().Stop();TimeLine_ZXS_Slider.value 0;CancelInvoke(DelayedExeCuteSlider);}}//将TimeLine运行的时间反馈给滑动条//time 是运行的时间duration是总时间slider的值范围0-1所以用time /duration即可//这个方法可以放在Update里面当然考虑到性能只有在漫游巡检时在赋值即可通过携程或者Invoke重复调用private void DelayedExeCuteSlider(){TimeLine_ZXS_Slider.value (float)(TimeLine_ZXS.GetComponentPlayableDirector().time / TimeLine_ZXS.GetComponentPlayableDirector().duration);} 这里是井队天高任鸟飞海阔凭鱼跃点个关注不迷路我们下期再见。