diff --git a/GFramework.Core/Coroutine/CoroutineScheduler.cs b/GFramework.Core/Coroutine/CoroutineScheduler.cs index 05fa1f06..b11a5e57 100644 --- a/GFramework.Core/Coroutine/CoroutineScheduler.cs +++ b/GFramework.Core/Coroutine/CoroutineScheduler.cs @@ -38,7 +38,6 @@ public sealed class CoroutineScheduler( new(); private readonly Dictionary _completionStatuses = new(); - private readonly CoroutineExecutionStage _executionStage = executionStage; private readonly Dictionary> _grouped = new(); private readonly ILogger _logger = LoggerFactoryResolver.Provider.CreateLogger(nameof(CoroutineScheduler)); private readonly Dictionary _metadata = new(); @@ -69,7 +68,7 @@ public sealed class CoroutineScheduler( /// /// 获取当前调度器代表的执行阶段。 /// - public CoroutineExecutionStage ExecutionStage => _executionStage; + public CoroutineExecutionStage ExecutionStage => executionStage; /// /// 获取活跃协程数量。 @@ -234,7 +233,7 @@ public sealed class CoroutineScheduler( _slots[slotIndex] = slot; _metadata[handle] = new CoroutineMetadata { - ExecutionStage = _executionStage, + ExecutionStage = executionStage, Group = group, Priority = priority, SlotIndex = slotIndex, @@ -756,8 +755,8 @@ public sealed class CoroutineScheduler( { return instruction switch { - WaitForFixedUpdate => _executionStage == CoroutineExecutionStage.FixedUpdate, - WaitForEndOfFrame => _executionStage == CoroutineExecutionStage.EndOfFrame, + WaitForFixedUpdate => executionStage == CoroutineExecutionStage.FixedUpdate, + WaitForEndOfFrame => executionStage == CoroutineExecutionStage.EndOfFrame, _ => true }; }