You can’t unload a proxy from a script component within the proxy. The recommendation is to unload from some script that will not be unloaded (ie from a central controller script or similar).
function init(self)
msg.post("/proxy#proxyMsg1", "load")
end
function on_message(self, message_id, message, sender)
if message_id == hash("proxy_loaded") then
msg.post(sender, "init")
msg.post(sender, "enable")
end
I check it and it works.
But what if in init I want to load second proxy in advance and looks like this
function init(self)
msg.post("/proxy#proxyMsg1", "load")
msg.post("/proxy#proxyMsg2", "load")
end
in on_message function, how does if message_id == hash(“proxy_loaded”) knows for which proxy I am asking?
Oh yes, I understand that, I was thinking if I have 2 proxies to load from init(), does one argument “proxy_loaded” checks for all proxies from init() if they are loaded, and can I separate it, check if first proxy1 is loaded, and then later (when I need it) to check if second proxy2 is loaded.