# UnityTimeService **Repository Path**: GameDevLee/UnityTimeService ## Basic Information - **Project Name**: UnityTimeService - **Description**: 基于Unity的定时服务,可完全弃用协程,支持延时调用,定时调用,指定时间内的Update调用,完全不需要初始化,一行代码直接使用 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-02-25 - **Last Updated**: 2023-09-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

Simple Icons

TimeService

## 介绍 基于Unity多平台的定时服务,替代协程 支持**延时**调用,**定时**调用 支持创建指定时间内的**Update调用(Update,LateUpdate,FixUpdate)** 支持设置Unscale模式,支持设置倍率 无需初始化,一行代码,直接使用 ***觉得我的插件能帮助到你,不妨请我喝杯咖啡或者点个Star⭐支持一下,有你的支持,我才能继续做出更好的插件❤️*** Simple Icons **☎️商务合作/联系作者:419731519(QQ)** ### 安装插件 - **Packages/manifest.json**中添加以下行: ```json { "dependencies": { "com.leeframework.time":"https://e.coding.net/ggdevlee/leeframework/TimeService.git#1.0.0" } } ``` ### 如何使用? Unity - 延迟调用 > **参数说明💡**\ > **delay:延迟时间(毫秒)**\ > **onTimeUp:回调**\ > **loop:循环次数**\ > **tag:标识** ```csharp pulic static DelayTask AddDelayTask(int delay, Action onTimeUp, int loop = 1, string tag = ""); //示例: //延迟3秒调用 TimeSvc.AddDelayTask(3000, () => { Debug.Log("time up"); }); ``` - 定时调用 ```csharp //延迟3秒调用 TimeSvc.AddTargetTask(new DateTime(2023, 8, 29), () => { Debug.Log("time up"); }); ```