Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CLLPHotWheel.lua
2020-07-04 14:41:25 +08:00

61 lines
1.5 KiB
Lua

-- 风火轮
do
local pName = nil;
local csSelf = nil;
local transform = nil;
local gameObject = nil;
local LabelMsg = nil;
local MaxShowTime = 10; --秒
local msg = nil;
local times = 0;
local PanelHotWheel = {}
function PanelHotWheel.init(go)
pName = go.name;
csSelf = go;
transform = csSelf.transform;
gameObject = csSelf.gameObject;
LabelMsg = getChild(transform, "LabelMsg"):GetComponent("UILabel");
end
function PanelHotWheel.setData(pars)
msg = pars;
if (msg == nil or msg == "") then
msg = Localization.Get("Loading");
end
end
function PanelHotWheel.show()
csSelf.panel.depth = CLUIInit.self.PanelHotWheelDepth;
times = times + 1;
csSelf:invoke4Lua(PanelHotWheel.hideSelf, MaxShowTime);
end
function PanelHotWheel.refresh()
LabelMsg.text = msg;
end
function PanelHotWheel.hideSelf(...)
if (times <= 0) then
times = 0;
return;
end
times = times - 1;
if (times <= 0) then
times = 0;
--CLAlert.add("hide PanelHotWheel==", Color.red, 2);
csSelf:cancelInvoke4Lua();
CLPanelManager.hidePanel(csSelf);
else
csSelf:invoke4Lua(PanelHotWheel.hideSelf, MaxShowTime);
end
end
function PanelHotWheel.hide()
csSelf:cancelInvoke4Lua();
end
return PanelHotWheel;
end