mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 实现ICoroutineContext和ICoroutineHandle接口,提供协程上下文和句柄的标准定义 - 重构CoroutineContext实现ICoroutineContext接口,统一协程上下文访问方式 - 修改CoroutineHandle实现ICoroutineHandle接口,标准化协程控制方法 - 扩展ICoroutineScheduler和ICoroutineScope接口,增加ActiveCount属性和Launch方法 - 优化CoroutineScheduler线程安全性,添加线程ID检查防止跨线程调用 - 为WaitForSeconds、WaitUntil、WaitWhile添加Reset方法支持状态重置 - 重构CoroutineScopeExtensions移除类型转换,使用接口方法替代具体类型 - 改进GlobalCoroutineScope添加TryGetScope方法,使用TryGet模式替代异常控制 - 优化CoroutineHandle取消逻辑,确保取消时正确触发OnComplete事件 - 统一各协程组件的XML文档注释,完善参数和返回值说明 - [skip ci]
22 lines
503 B
C#
22 lines
503 B
C#
namespace GFramework.Game.Abstractions.coroutine;
|
|
|
|
/// <summary>
|
|
/// 协程上下文接口,提供协程执行所需的上下文信息
|
|
/// </summary>
|
|
public interface ICoroutineContext
|
|
{
|
|
/// <summary>
|
|
/// 获取协程作用域
|
|
/// </summary>
|
|
ICoroutineScope Scope { get; }
|
|
|
|
/// <summary>
|
|
/// 获取协程调度器
|
|
/// </summary>
|
|
ICoroutineScheduler Scheduler { get; }
|
|
|
|
/// <summary>
|
|
/// 获取协程所有者对象
|
|
/// </summary>
|
|
object? Owner { get; }
|
|
} |