Add managed entity and script component.

Added ManagedEntity and related methods in EntityManager;
Added ScriptComponent to write game play logic in oop;
This commit is contained in:
2025-12-10 16:12:56 +09:00
parent 99c1a1980e
commit 21e85e0c02
17 changed files with 549 additions and 152 deletions

View File

@@ -94,7 +94,7 @@ public unsafe partial struct EntityQuery
{
_currentChunk = ref _currentArchetype.GetChunkReference(chunkIndex);
_chunkBasePtr = _currentChunk.GetUnsafePtr();
_currentChunkEntityCount = _currentChunk.Count;
_currentChunkEntityCount = _currentChunk._count;
for (var index = 0; index < <#= i #>; index++)
{
@@ -110,7 +110,7 @@ public unsafe partial struct EntityQuery
while (true)
{
_currentEntityIndex++;
if (_currentEntityIndex < _currentChunk.Count)
if (_currentEntityIndex < _currentChunk._count)
{
var pChunkData = _currentChunk.GetUnsafePtr();
if (IsEntityValid(pChunkData, _currentEntityIndex, in _currentArchetype, in _mask))