function init(self: MyNode, context: Context): boolean
local vmi = context:viewModel()
if vmi then
local cannon = vmi:getTrigger('cannon')
if cannon then
self.cannon = cannon
self.onCannonFired = onCannonFired
cannon:addListener(onCannonFired)
end
end
return true
end
function removeCannonListener(self: MyNode)
if self.cannon then
self.cannon:removeListener(self.onCannonFired)
end
end