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)
直接修复父类的函数、并在父类的函数中判断类型来执行相应的操作。