Unity3D之定时器和延时器

一, 前言      因为做过H5游戏的开发,所以对 setInterval、setTimeout特别的亲切, 但是对于Unity的Invoke、InvokeRepeating这2货,就稍稍觉得有些懵逼了.慢慢适应吧 ​ 二, 使用方法 void Invoke(string methodName, float time);//时间单位为秒 //在time秒后调用方法, 然后每秒都调用 void InvokeRepeating(string methodName, float time, float repeatRate); ​ 三, 案例      1, 场景      2, 代码 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class SetTimeOutDemo : MonoBehaviour { private Button btnIn; private Button btnRe; // Start is called before the first frame update void Start() { this.btnIn = this.transform.Find("btnIn").gameObject.GetComponent

尚美源码坑位教程提供精美的网站源码教程,小程序、公众号、H5、APP、游戏、直播、支付、区块链、商城、影音、小说等源码信息大全。
尚美源码教程库 » Unity3D之定时器和延时器
赞助VIP 享更多特权,立即登录下载海量资源
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡