Arch.AOT.SourceGenerator
Arch.AOT.SourceGenerator, making arch fully AOT compatible.
Example
[Component]
public struct Velocity{ ... }
[Component]
public struct Transform{ ... }namespace Arch.AOT.SourceGenerator
{
internal static class GeneratedComponentRegistry
{
[ModuleInitializer]
public static void Initialize()
{
ComponentRegistry.Add(new ComponentType(ComponentRegistry.Size + 1, typeof(Velocity), Unsafe.SizeOf<Velocity>(), false);
ArrayRegistry.Add<Velocity>();
ComponentRegistry.Add(new ComponentType(ComponentRegistry.Size + 1, typeof(Transform), Unsafe.SizeOf<Transform>(), false);
ArrayRegistry.Add<Transform>();
}
}
}Last updated