Added new RHI abstraction layer;
Added new console debug page to UnitTest;
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user