-
-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Description
We need something to handle the lifetime of the ecs app and the ability to extend it.
Something like this for an api would be nice...
var runner = new Runner();
runner.Add(new DefaultPlugin())
runner.Run();
[Query]
private static void DefaultPlugin(in ICommandBuffer buffer)
{
buffer.Add(new PrintSystem());
var world = buffer.CreateWorld();
var entity = world.CreateEntity(new Message("hi"))
// Do something with entity?
}
[Query][All<Message>]
private static void PrintSystem(ref Message message)
{
Console.WriteLine(message.Text);
}
I would even say rename QueryAttribute to SystemAttribute and have a PluginAttribute.
var runner = new Runner();
runner.Add(new DefaultPlugin())
runner.Run();
[Plugin]
private static void DefaultPlugin(in ICommandBuffer buffer)
{
buffer.Add(new PrintSystem());
var world = buffer.CreateWorld();
var entity = world.CreateEntity(new Message("hi"))
// Do something with entity?
}
[System][All<Message>]
private static void PrintSystem(ref Message message)
{
Console.WriteLine(message.Text);
}
There does need to be a way to post a quit message to the Runner though.
Metadata
Metadata
Assignees
Labels
No labels