From 628a39b9f85b41203be502384b74f505f685f8ae Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:24:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor(scene):=20=E4=BF=AE=E6=94=B9=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=A0=88=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B=E4=B8=BA?= =?UTF-8?q?IEnumerable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将Stack属性的返回类型从IReadOnlyList改为IEnumerable - 更新接口定义中的返回类型保持一致 - 优化内部实现直接返回可枚举集合而不是转换为列表 - 更新文档注释明确说明栈底到栈顶的顺序 --- GFramework.Game.Abstractions/scene/ISceneRouter.cs | 2 +- GFramework.Game/scene/SceneRouterBase.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/GFramework.Game.Abstractions/scene/ISceneRouter.cs b/GFramework.Game.Abstractions/scene/ISceneRouter.cs index d7708a5..c71f6ba 100644 --- a/GFramework.Game.Abstractions/scene/ISceneRouter.cs +++ b/GFramework.Game.Abstractions/scene/ISceneRouter.cs @@ -38,7 +38,7 @@ public interface ISceneRouter : ISystem /// 获取场景行为对象的只读列表,表示当前的场景栈结构。 /// 列表中第一个元素为栈底场景,最后一个元素为当前活动场景。 /// - IReadOnlyList Stack { get; } + IEnumerable Stack { get; } /// /// 获取场景路由器是否正在进行场景切换操作。 diff --git a/GFramework.Game/scene/SceneRouterBase.cs b/GFramework.Game/scene/SceneRouterBase.cs index 62de16f..1425f4d 100644 --- a/GFramework.Game/scene/SceneRouterBase.cs +++ b/GFramework.Game/scene/SceneRouterBase.cs @@ -53,10 +53,9 @@ public abstract class SceneRouterBase public string? CurrentKey => Current?.Key; /// - /// 获取场景栈的只读列表,按压入顺序排列。 + /// 获取场景栈的只读视图,按压入顺序排列(从栈底到栈顶)。 /// - public IReadOnlyList Stack => - _stack.Reverse().ToList(); + public IEnumerable Stack => _stack.Reverse(); /// /// 获取是否正在进行场景转换。