PGRData/Script/matrix/xui/xuiautofightdialog/XUiImgIcon.lua

41 lines
985 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local XUiImgIcon = XClass(nil, "XUiImgIcon")
function XUiImgIcon:Ctor(ui)
self.GameObject = ui.gameObject
self.Transform = ui.transform
self:InitAutoScript()
end
-- auto
-- Automatic generation of code, forbid to edit
function XUiImgIcon:InitAutoScript()
self:AutoInitUi()
self:AutoAddListener()
end
function XUiImgIcon:AutoInitUi()
self.ImgIcon = self.Transform:GetComponent("Image")
end
function XUiImgIcon:RegisterClickEvent(uiNode, func)
if func == nil then
XLog.Error("XUiImgIcon:RegisterClickEvent函数参数错误参数func不能为空")
return
end
if type(func) ~= "function" then
XLog.Error("XUiImgIcon:RegisterClickEvent函数错误, 参数func需要是function类型, func的类型是" .. type(func))
end
local listener = function(...)
func(self, ...)
end
CsXUiHelper.RegisterClickEvent(uiNode, listener)
end
function XUiImgIcon:AutoAddListener()
end
-- auto
return XUiImgIcon