[unity] implementation after clicking a button, delay and switch the background image/interface

There might be a better way, but so far I’ve found that you can do this, and you can try other ways.

 

Goal: In UNITY, after clicking a button, three screens (or Raw images) appear in sequence: the first screen appears 1 second later, the second screen appears 3 seconds later and the first screen disappears, and the third screen appears 3 seconds later and the second screen disappears. The first step is to create a C# script in Assets, let’s name it delaydisplay3, double-click visual studio to open the edit.

unity实现点击按钮多次延迟切换背景图片/界面

本人学习了一下的小白写法,可能有更好的方式,但是目前我发现可以这么做,大家也可以试试其他方法。

目标:在UNITY中,点击按钮后,有三个界面(或Raw image)依次显示:第一个界面延迟1秒出现,第二个界面延迟3秒出现且第一个界面消失,第三个界面再延迟3秒出现且第二个界面消失。

首先是在Assets里面新建一个C#脚本,我们就命名为delaydisplay3吧,双击打开visual studio进行编辑。