From 231182e7c2b1911d7cab32c8c6bbe94047acd024 Mon Sep 17 00:00:00 2001 From: bakpakin Date: Sun, 29 Mar 2015 07:02:14 +0800 Subject: [PATCH] Add method for activating and deactivating Systems in Worlds. --- jojo.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jojo.lua b/jojo.lua index 23eebff..9d54e97 100644 --- a/jojo.lua +++ b/jojo.lua @@ -442,4 +442,13 @@ function World:clearSystems() self.systemsToRemove = newSystemsToRemove end +-- World:setSystemActive(system, active) + +-- Sets if a System is active in a world. If the system is active, it will +-- update automatically when World:update(dt) is called. Otherwise, the user +-- must call World:updateSystem(system, dt) to update the unactivated system. +function World:setSystemActive(system, active) + self.activeSystem[system] = active and true or nil +end + return jojo