GeWuYou fb14d7122c docs(style): 更新文档中的命名空间导入格式
- 将所有小写的命名空间导入更正为首字母大写格式
- 统一 GFramework 框架的命名空间引用规范
- 修复 core、ecs、godot 等模块的命名空间导入错误
- 标准化文档示例代码中的 using 语句格式
- 确保所有文档中的命名空间引用保持一致性
- 更新 global using 语句以匹配正确的命名空间格式
2026-03-10 07:18:49 +08:00

31 lines
992 B
C#

using GFramework.Core.Abstractions.Architecture;
namespace GFramework.Ecs.Arch.Extensions;
/// <summary>
/// Arch ECS 扩展方法
/// </summary>
public static class ArchExtensions
{
/// <summary>
/// 添加 Arch ECS 支持到架构中
/// </summary>
/// <typeparam name="TArchitecture">架构类型</typeparam>
/// <param name="architecture">架构实例</param>
/// <param name="configure">可选的配置委托</param>
/// <returns>架构实例,支持链式调用</returns>
public static TArchitecture UseArch<TArchitecture>(
this TArchitecture architecture,
Action<ArchOptions>? configure = null)
where TArchitecture : IArchitecture
{
// 配置选项
var options = new ArchOptions();
configure?.Invoke(options);
// 注册模块(传递配置选项)
ArchitectureModuleRegistry.Register(() => new ArchEcsModule(options, enabled: true));
return architecture;
}
}