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

提供全面的网站源码正版坑位,小程序、APP、H5、支付、游戏、区块链、商城、直播、影音、小说、公众号等源码学习交流。
精品源码资源网 » Unity3D之定时器和延时器
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡