_G.UIFather = {}
function UIFather:New(prefab)
local t = { ["prefab"] = prefab }
setmetatable(t, self)
self.__index = self
return t
end
function UIFather:RegisterCloseEvent(instance, func, ...)
function UIFather:OnEvent(event,param)
end
end
function UIFather:OnEnable(instance)
end
function UIFather:OnDisable(instance)
end
_G.A = _G.UIFather:New()
print("母函數調用之前" ,A["OnEnable"], A["OnEvent"],UIFather["OnEvent"])
UIFather:RegisterCloseEvent()
print("母函數調用之後" ,A["OnEnable"], A["OnEvent"],UIFather["OnEvent"])
調用結果爲:
母函數調用之前 function: 0054CDF0 nil nil
母函數調用之後 function: 0054CDF0 function: 0054CE70 function: 0054CE70
[Finished in 0.1s]