2020-07-04 14:41:25 +08:00
|
|
|
|
require("public.class")
|
|
|
|
|
|
---@class TRBasePanel:ClassBase
|
|
|
|
|
|
local TRBasePanel = class("TRBasePanel")
|
|
|
|
|
|
|
|
|
|
|
|
-- 初始化,只会调用一次
|
|
|
|
|
|
---@param csObj Coolape.CLPanelLua
|
|
|
|
|
|
function TRBasePanel:init(csObj)
|
|
|
|
|
|
self.uiobjs = {}
|
|
|
|
|
|
---@type Coolape.CLPanelLua
|
|
|
|
|
|
self.csSelf = csObj
|
|
|
|
|
|
---@type UnityEngine.Transform
|
|
|
|
|
|
self.transform = csObj.transform
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
---public 当有通用背板显示时的回调
|
|
|
|
|
|
---@param cs Coolape.CLPanelLua
|
|
|
|
|
|
function TRBasePanel:onShowFrame(cs)
|
|
|
|
|
|
if cs.frameObj then
|
|
|
|
|
|
---@type _BGFrame1Param
|
|
|
|
|
|
local d = {}
|
|
|
|
|
|
-- d.title = LGet(cs.titleKeyName)
|
|
|
|
|
|
d.title = cs.titleKeyName
|
|
|
|
|
|
d.panel = cs
|
|
|
|
|
|
cs.frameObj:init(d)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
|
|
|
|
|
function TRBasePanel:hideSelfOnKeyBack()
|
2020-08-06 22:56:33 +08:00
|
|
|
|
if NetProto and self.csSelf then
|
|
|
|
|
|
NetProto.removePanelListener(self.csSelf)
|
|
|
|
|
|
end
|
2020-07-04 14:41:25 +08:00
|
|
|
|
return true
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------
|
|
|
|
|
|
return TRBasePanel
|