xlua修复子类中未实现的父类函数
xlua.hotfix(ClsType, "Method", function(self, a, b)
if type(a) == "userdata" then
if a:GetType() == CS.A.UnderlyingSystemType then
print("A hotfix")
elseif a:GetType() == CS.B.UnderlyingSystemType then
print("B hotfix")
end
elseif type(a) == "number" then
print(a + b)
elseif type(a) == "string" then
print(a..b)
else
base(self):Func()
end
end)
直接修复父类的函数、并在父类的函数中判断类型来执行相应的操作。

浙公网安备 33010602011771号