ECS refactor: new ComponentSet, serialization, generators
Major ECS API overhaul: added ComponentSet, refactored ComponentRegistry, and updated all entity/component creation methods. Introduced robust custom serialization infrastructure and per-component source generators for registration and (de)serialization. Updated editor, engine, and test code to use new APIs. Improved code quality, naming, and performance throughout. Removed obsolete code and updated dependencies.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Ghost.Test.Core;
|
||||
using Misaki.HighPerformance.Jobs;
|
||||
using Misaki.HighPerformance.LowLevel.Buffer;
|
||||
using Misaki.HighPerformance.Mathematics;
|
||||
|
||||
namespace Ghost.Entities.Test;
|
||||
@@ -40,7 +41,11 @@ public partial class EntityQueryTest : ITest
|
||||
public void Run()
|
||||
{
|
||||
var entities = (Span<Entity>)stackalloc Entity[1000];
|
||||
_world.EntityManager.CreateEntities(entities, ComponentTypeID<Transform>.value);
|
||||
|
||||
using var scope = AllocationManager.CreateStackScope();
|
||||
using var set = new ComponentSet(scope.AllocationHandle, ComponentTypeID<Transform>.Value);
|
||||
|
||||
_world.EntityManager.CreateEntities(entities, set);
|
||||
|
||||
var queryID = new QueryBuilder().WithAllRW<Transform>().Build(_world);
|
||||
ref var query = ref _world.GetEntityQueryReference(queryID);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<PublishAot>True</PublishAot>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -14,7 +14,7 @@ internal class SystemTest : ITest
|
||||
_world = World.Create(_jobScheduler);
|
||||
}
|
||||
|
||||
public void Run()
|
||||
public void Run()
|
||||
{
|
||||
var group = _world.SystemManager.GetSystem<DefaultSystemGroup>();
|
||||
group.AddSystem<TestSystemB>();
|
||||
|
||||
Reference in New Issue
Block a user