Partial entity inspector

This commit is contained in:
2024-01-07 13:49:13 +01:00
parent 5dbc5ba15e
commit 9c745d2857
9 changed files with 276 additions and 56 deletions

View File

@@ -29,10 +29,17 @@ ECS_MOVE(Path, dst, src, {
})
ECS_DTOR(Arms, arms, {
if (arms->primary)
if (arms->primary) {
ecs_delete(ECS, arms->primary);
if (arms->secondary)
arms->primary = 0;
}
if (arms->secondary) {
ecs_delete(ECS, arms->secondary);
arms->secondary = 0;
}
})
ECS_MOVE(Arms, dst, src, {
*dst = *src;
});
void setupSystems() {
@@ -45,7 +52,8 @@ void setupSystems() {
.move_dtor = ecs_move(Path)
});
ecs_set_hooks(ECS, Arms, {
.dtor = ecs_dtor(Arms)
.dtor = ecs_dtor(Arms),
.move_dtor = ecs_move(Arms)
});
ECS_OBSERVER(ECS, entityPathRemove, EcsOnRemove, Path);