mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 重命名命名空间从GFramework.Game.Abstractions.coroutine到GFramework.Core.Abstractions.coroutine - 更新ICoroutineContext.cs、ICoroutineHandle.cs、ICoroutineScheduler.cs、 ICoroutineScope.cs、ICoroutineSystem.cs、IYieldInstruction.cs的命名空间 - 更新测试覆盖率计划文档,添加协程模块测试计划 - 新增协程模块测试计划,包含15个源文件,计划91个测试用例 - 添加CoroutineHandleTests.cs等7个协程相关测试文件的计划
29 lines
872 B
C#
29 lines
872 B
C#
using GFramework.Core.Abstractions.coroutine;
|
|
using GFramework.Core.coroutine;
|
|
using GFramework.Core.system;
|
|
|
|
namespace GFramework.Game.coroutine;
|
|
|
|
/// <summary>
|
|
/// 协程系统类,负责管理和更新协程调度器
|
|
/// </summary>
|
|
/// <param name="scheduler">协程调度器实例</param>
|
|
public class CoroutineSystem(CoroutineScheduler scheduler) : AbstractSystem, ICoroutineSystem
|
|
{
|
|
/// <summary>
|
|
/// 更新协程系统,驱动协程调度器执行协程逻辑
|
|
/// </summary>
|
|
/// <param name="deltaTime">时间间隔,表示自上一帧以来经过的时间(秒)</param>
|
|
public void OnUpdate(float deltaTime)
|
|
{
|
|
// 更新协程调度器,处理等待中的协程
|
|
scheduler.Update(deltaTime);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化协程系统
|
|
/// </summary>
|
|
protected override void OnInit()
|
|
{
|
|
}
|
|
} |