From 536f42ddc690d2c35e77efbb40fc418cdc5c6fc8 Mon Sep 17 00:00:00 2001 From: Justin van der Leij Date: Mon, 30 Jul 2018 13:48:31 +0200 Subject: [PATCH] Added callbacks when the System is added as well --- lib/instance.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/instance.lua b/lib/instance.lua index 451ef50..7a66c84 100644 --- a/lib/instance.lua +++ b/lib/instance.lua @@ -120,6 +120,12 @@ function Instance:addSystem(system, eventName, callback, enabled) callback = callback or eventName, enabled = enabled == nil and true or enabled, } + + if enabled then + system:enabledCallback(callback or eventName) + else + system:disabledCallback(callback or eventName) + end end local e