From daff1fa12b6e55aa003066af4efb3878f8667eba Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Mon, 23 Feb 2026 08:51:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(architecture):=20=E9=9B=86=E6=88=90Arch=20?= =?UTF-8?q?ECS=E6=A1=86=E6=9E=B6=E5=B9=B6=E5=8D=87=E7=BA=A7=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在ArchitectureContext中添加ECS世界和系统调度器支持 - 添加IEcsWorld和IEcsSystem接口定义 - 实现EcsWorld、EcsSystemBase和EcsSystemRunner核心类 - 添加Position和Velocity示例组件及MovementSystem示例 - 创建ECS使用示例代码 - 将多个项目的TargetFramework从netstandard2.0升级到netstandard2.1 - 添加Arch和Arch.System包依赖到核心项目 - 在测试项目中添加ECS相关接口的模拟实现 --- .../Directory.Build.props | 4 +- .../GFramework.Core.Abstractions.csproj | 3 +- .../architecture/IArchitectureContext.cs | 15 +++++ .../ecs/IEcsSystem.cs | 20 ++++++ GFramework.Core.Abstractions/ecs/IEcsWorld.cs | 44 ++++++++++++ .../architecture/ArchitectureServicesTests.cs | 11 +++ .../architecture/GameContextTests.cs | 11 +++ GFramework.Core/GFramework.Core.csproj | 2 + .../architecture/ArchitectureContext.cs | 59 ++++++++++++++++ GFramework.Core/ecs/EcsSystemBase.cs | 62 +++++++++++++++++ GFramework.Core/ecs/EcsSystemRunner.cs | 66 ++++++++++++++++++ GFramework.Core/ecs/EcsWorld.cs | 66 ++++++++++++++++++ GFramework.Core/ecs/components/Position.cs | 16 +++++ GFramework.Core/ecs/components/Velocity.cs | 16 +++++ .../ecs/examples/EcsUsageExample.cs | 67 +++++++++++++++++++ GFramework.Core/ecs/systems/MovementSystem.cs | 31 +++++++++ .../Directory.Build.props | 2 +- .../GFramework.Game.Abstractions.csproj | 2 +- .../internals/IsExternalInit.cs | 2 +- .../Directory.Build.props | 2 +- ...Godot.SourceGenerators.Abstractions.csproj | 2 +- .../GFramework.Godot.SourceGenerators.csproj | 2 +- .../Directory.Build.props | 2 +- ...ework.SourceGenerators.Abstractions.csproj | 2 +- .../Directory.Build.props | 2 +- .../GFramework.SourceGenerators.Common.csproj | 2 +- .../GFramework.SourceGenerators.csproj | 2 +- 27 files changed, 501 insertions(+), 14 deletions(-) create mode 100644 GFramework.Core.Abstractions/ecs/IEcsSystem.cs create mode 100644 GFramework.Core.Abstractions/ecs/IEcsWorld.cs create mode 100644 GFramework.Core/ecs/EcsSystemBase.cs create mode 100644 GFramework.Core/ecs/EcsSystemRunner.cs create mode 100644 GFramework.Core/ecs/EcsWorld.cs create mode 100644 GFramework.Core/ecs/components/Position.cs create mode 100644 GFramework.Core/ecs/components/Velocity.cs create mode 100644 GFramework.Core/ecs/examples/EcsUsageExample.cs create mode 100644 GFramework.Core/ecs/systems/MovementSystem.cs diff --git a/GFramework.Core.Abstractions/Directory.Build.props b/GFramework.Core.Abstractions/Directory.Build.props index 1e6c3bf..7417131 100644 --- a/GFramework.Core.Abstractions/Directory.Build.props +++ b/GFramework.Core.Abstractions/Directory.Build.props @@ -1,7 +1,7 @@ - + - netstandard2.0 + netstandard2.1 true true - netstandard2.0 + netstandard2.1 true true - netstandard2.0 + netstandard2.1 true true true diff --git a/GFramework.SourceGenerators.Abstractions/Directory.Build.props b/GFramework.SourceGenerators.Abstractions/Directory.Build.props index 82f43af..7417131 100644 --- a/GFramework.SourceGenerators.Abstractions/Directory.Build.props +++ b/GFramework.SourceGenerators.Abstractions/Directory.Build.props @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.1 true true - netstandard2.0 + netstandard2.1 true true true