From 3859098b7e44645a6d6aec2d138e63b7a4fab8ce Mon Sep 17 00:00:00 2001
From: GeWuYou <95328647+GeWuYou@users.noreply.github.com>
Date: Sun, 18 Jan 2026 22:45:41 +0800
Subject: [PATCH] =?UTF-8?q?refactor(godot):=20=E9=87=8D=E6=9E=84Godot=20UI?=
=?UTF-8?q?=E6=B3=A8=E5=86=8C=E8=A1=A8=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E5=92=8C=E7=B1=BB=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将IGodotAssetRegistry重命名为IGodotUiRegistry
- 将GodotAssetRegistry重命名为GodotUiRegistry
- 更新GodotUiFactory中的依赖注入类型
- 为IGodotSceneRegistry接口添加详细的XML文档注释
- 移除GodotUiFactory中不必要的Godot命名空间引用
---
GFramework.Godot/scene/IGodotSceneRegistry.cs | 3 +++
GFramework.Godot/ui/GodotUiFactory.cs | 5 ++---
.../ui/{GodotAssetRegistry.cs => GodotUiRegistry.cs} | 4 ++--
.../ui/{IGodotAssetRegistry.cs => IGodotUiRegistry.cs} | 2 +-
4 files changed, 8 insertions(+), 6 deletions(-)
rename GFramework.Godot/ui/{GodotAssetRegistry.cs => GodotUiRegistry.cs} (87%)
rename GFramework.Godot/ui/{IGodotAssetRegistry.cs => IGodotUiRegistry.cs} (81%)
diff --git a/GFramework.Godot/scene/IGodotSceneRegistry.cs b/GFramework.Godot/scene/IGodotSceneRegistry.cs
index 44dcc05..da527e2 100644
--- a/GFramework.Godot/scene/IGodotSceneRegistry.cs
+++ b/GFramework.Godot/scene/IGodotSceneRegistry.cs
@@ -3,4 +3,7 @@ using Godot;
namespace GFramework.Godot.scene;
+///
+/// Godot场景注册表接口,用于管理PackedScene资源的注册和访问
+///
public interface IGodotSceneRegistry : IAssetRegistry;
\ No newline at end of file
diff --git a/GFramework.Godot/ui/GodotUiFactory.cs b/GFramework.Godot/ui/GodotUiFactory.cs
index b7d494f..8794e34 100644
--- a/GFramework.Godot/ui/GodotUiFactory.cs
+++ b/GFramework.Godot/ui/GodotUiFactory.cs
@@ -1,7 +1,6 @@
using GFramework.Core.extensions;
using GFramework.Core.utility;
using GFramework.Game.Abstractions.ui;
-using Godot;
namespace GFramework.Godot.ui;
@@ -14,7 +13,7 @@ public class GodotUiFactory : AbstractContextUtility, IUiFactory
///
/// UI注册表,用于存储和获取PackedScene类型的UI资源
///
- private IAssetRegistry _registry = null!;
+ private IGodotUiRegistry _registry = null!;
///
/// 根据指定的UI键创建UI页面实例
@@ -44,6 +43,6 @@ public class GodotUiFactory : AbstractContextUtility, IUiFactory
///
protected override void OnInit()
{
- _registry = this.GetUtility>()!;
+ _registry = this.GetUtility()!;
}
}
\ No newline at end of file
diff --git a/GFramework.Godot/ui/GodotAssetRegistry.cs b/GFramework.Godot/ui/GodotUiRegistry.cs
similarity index 87%
rename from GFramework.Godot/ui/GodotAssetRegistry.cs
rename to GFramework.Godot/ui/GodotUiRegistry.cs
index 923df57..69d4ae8 100644
--- a/GFramework.Godot/ui/GodotAssetRegistry.cs
+++ b/GFramework.Godot/ui/GodotUiRegistry.cs
@@ -8,5 +8,5 @@ namespace GFramework.Godot.ui;
/// 继承自KeyValueRegistryBase,使用字符串作为键,PackedScene作为值进行存储
/// 实现IUiRegistry接口,提供UI场景的注册和管理功能
///
-public class GodotAssetRegistry()
- : KeyValueRegistryBase(StringComparer.Ordinal), IGodotAssetRegistry;
\ No newline at end of file
+public class GodotUiRegistry()
+ : KeyValueRegistryBase(StringComparer.Ordinal), IGodotUiRegistry;
\ No newline at end of file
diff --git a/GFramework.Godot/ui/IGodotAssetRegistry.cs b/GFramework.Godot/ui/IGodotUiRegistry.cs
similarity index 81%
rename from GFramework.Godot/ui/IGodotAssetRegistry.cs
rename to GFramework.Godot/ui/IGodotUiRegistry.cs
index ee3522b..a2758cc 100644
--- a/GFramework.Godot/ui/IGodotAssetRegistry.cs
+++ b/GFramework.Godot/ui/IGodotUiRegistry.cs
@@ -7,4 +7,4 @@ namespace GFramework.Godot.ui;
/// Godot UI注册表接口,用于管理PackedScene类型的UI资源注册和管理
/// 继承自通用UI注册表接口,专门针对Godot引擎的PackedScene资源类型
///
-public interface IGodotAssetRegistry : IAssetRegistry;
\ No newline at end of file
+public interface IGodotUiRegistry : IAssetRegistry;
\ No newline at end of file