Added new RHI abstraction layer;

Added new console debug page to UnitTest;
This commit is contained in:
2025-08-25 10:48:59 +09:00
parent eafbfb2fa1
commit 5385141f14
44 changed files with 3473 additions and 357 deletions

View File

@@ -1,5 +1,4 @@
using Ghost.Core.Attributes;
using Ghost.Entities;
using System.Reflection;
namespace Ghost.Editor.Core.Utilities;
@@ -34,29 +33,4 @@ public static class TypeCache
{
return _types;
}
}
public static class ComponentTypeCache
{
private static readonly Type?[][] _componentTypes;
static ComponentTypeCache()
{
_componentTypes = new Type[World.WorldCount][];
for (var i = 0; i < World.WorldCount; i++)
{
var world = World.GetWorld(i);
var typeHandles = world.ComponentStorage.ComponentPools.Keys;
_componentTypes[i] = typeHandles.Select(handle => handle.ToType()).ToArray();
}
}
public static Type?[] GetComponentTypes(int worldIndex)
{
if (worldIndex < 0 || worldIndex >= _componentTypes.Length)
{
throw new ArgumentOutOfRangeException(nameof(worldIndex), "Invalid world index.");
}
return _componentTypes[worldIndex];
}
}