mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-21 23:56:50 -06:00
Fix bug with deactivating Systems. Add test.
This commit is contained in:
@@ -138,6 +138,20 @@ describe('tiny-ecs:', function()
|
||||
assert.equals(timePassed, 0)
|
||||
assert.equals(entity1.xform.x, entityTemplate1.xform.x)
|
||||
end)
|
||||
|
||||
it("Disable and Enable Systems", function()
|
||||
world:setSystemActive(moveSystem, false)
|
||||
world:setSystemActive(oneTimeSystem, false)
|
||||
world:update(1)
|
||||
assert.equals(timePassed, 0)
|
||||
assert.equals(entity1.xform.x, entityTemplate1.xform.x)
|
||||
world:setSystemActive(moveSystem, true)
|
||||
world:setSystemActive(oneTimeSystem, true)
|
||||
world:update(1)
|
||||
assert.equals(timePassed, 1)
|
||||
assert.are_not.equal(entity1.xform.x, entityTemplate1.xform.x)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user