-events are simplified to handleEvent(Entity*,Event) (use entity.getComponent to get entity components)
This commit is contained in:
parent
9402e917f2
commit
beab56033c
2 changed files with 28 additions and 13 deletions
|
|
@ -376,22 +376,24 @@ struct TestSystem2
|
|||
//TestComp* tt;
|
||||
}
|
||||
|
||||
void handleEvent(EventInput input)
|
||||
/*void handleEvent(EventInput input)
|
||||
{
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
void handleEvent(EventInput input, ref TestEvent event)
|
||||
void handleEvent(/*EventInput input, */Entity* entity, ref TestEvent event)
|
||||
{
|
||||
input.test.bg = event.a;
|
||||
TestComp3* test = entity.getComponent!TestComp3;
|
||||
test.bg = event.a;
|
||||
TestEvent2 event2;
|
||||
event2.a = event.a + 8;
|
||||
gEM.sendEvent(input.entity.id, event2);
|
||||
gEM.sendEvent(entity.id, event2);
|
||||
}
|
||||
|
||||
void handleEvent(EventInput input, ref TestEvent2 event)
|
||||
void handleEvent(/*EventInput input, */Entity* entity, ref TestEvent2 event)
|
||||
{
|
||||
input.test.gg = cast(uint) event.a;
|
||||
TestComp3* test = entity.getComponent!TestComp3;
|
||||
test.gg = cast(uint) event.a;
|
||||
}
|
||||
|
||||
void onEnable()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue