unity实现点击按钮多次延迟切换背景图片/界面
本人学习了一下的小白写法,可能有更好的方式,但是目前我发现可以这么做,大家也可以试试其他方法。
目标:在UNITY中,点击按钮后,有三个界面(或Raw image)依次显示:第一个界面延迟1秒出现,第二个界面延迟3秒出现且第一个界面消失,第三个界面再延迟3秒出现且第二个界面消失。
首先是在Assets里面新建一个C#脚本,我们就命名为delaydisplay3吧,双击打开visual studio进行编辑。
隐者艾伦的技术博客
本人学习了一下的小白写法,可能有更好的方式,但是目前我发现可以这么做,大家也可以试试其他方法。
目标:在UNITY中,点击按钮后,有三个界面(或Raw image)依次显示:第一个界面延迟1秒出现,第二个界面延迟3秒出现且第一个界面消失,第三个界面再延迟3秒出现且第二个界面消失。
首先是在Assets里面新建一个C#脚本,我们就命名为delaydisplay3吧,双击打开visual studio进行编辑。
Plug-ins in unity are called packages or packages. In the development of hololens, it is often necessary to delete conflicting plug-ins due to various plug-in conflicts. For example, MRTK3 and MRTK2 plugins will conflict. So you need to use the following method to remove conflicting plug-ins.
Click on the menu bar window — Package Manager — select the package you want to delete and click remove. If it doesn’t work, just restart the editor and recompile it.
如何通过visual studio将应用程序部署到hololens2上面
假设我们已经通过unity开发完成,并且没有任何错误
首先,在unity中,点击左上角file—build setting打开打包配置页
按照下图如图所示配置,配置好构建的环境与细节配置
该方法主要是来自github的jdibenes/hl2ss:HoloLens 2 Sensor Streaming。 (来自于github.com)
大佬写的方法已经非常明确了,非常欣赏这种把代码解释的明明白白的大兄弟,我就说几个跑通过程中的一些小点:
需要软件平台:unity(导入微软的MRTK)、visual studio、Python或其他编译器(用pycharm或者vscode都可以)
需要硬件平台:一台有无线网卡的电脑、wifi路由器、HoloLens 2(需要先手动开启开发人员模式、设备门户、研究模式)即可。