----- 大闹天宫 回复 和 复活节点弹窗 ----- local this = {} --传入父脚本模块 local parent local sortingOrder local nodeType local nodeState local fun function this:InitComponent(gameObject) this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text") this.content=Util.GetGameObject(gameObject,"content"):GetComponent("Text") this.iconImage=Util.GetGameObject(gameObject,"iconImage"):GetComponent("Image") this.goBtn=Util.GetGameObject(gameObject,"GoBtn") this.goBtnText=Util.GetGameObject(gameObject,"GoBtn/Text"):GetComponent("Text") end function this:BindEvent() Util.AddOnceClick(this.goBtn,function() if fun then fun() fun = nil end parent:ClosePanel() end) end function this:AddListener() end function this:RemoveListener() end function this:OnShow(_parent,...) parent=_parent sortingOrder = _parent.sortingOrder --不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参 local _args = {...} nodeType = _args[1] nodeState = _args[2] fun = _args[3] this.RefreshPanel(nodeType,nodeState) end function this:OnClose() end function this:OnDestroy() end --刷新面板 function this.RefreshPanel() this.iconImage.sprite = Util.LoadSprite(ConfigManager.GetConfigData(ConfigName.ExpeditionNodeConfig,nodeType).Icon) if nodeType == ExpeditionNodeType.Reply then--回复节点 this.titleText.text="蟠桃树" local num = ConfigManager.GetConfigData(ConfigName.ExpeditionSetting,1).RegeneratePercent/100 if nodeState == ExpeditionNodeState.No then this.content.text = "挂满了千年蟠桃的蟠桃树,采摘食用可以让所有存活的神将恢复生命上限"..num.."%的生命值!" this.goBtnText.text = "确定" elseif nodeState == ExpeditionNodeState.NoPass then this.content.text = "挂满了千年蟠桃的蟠桃树,采摘食用可以让所有存活的神将恢复生命上限"..num.."%的生命值,是否采摘?" this.goBtnText.text = "前往" end elseif nodeType == ExpeditionNodeType.Resurgence then--复活节点 this.titleText.text="八卦炼丹炉" if nodeState == ExpeditionNodeState.No then this.content.text = "太上老君的炼丹炉,其中炼制着一颗能生死人肉白骨的神丹百转大还丹,可以随机复活一名阵亡的神将。如果没有阵亡的神将,则使一名随机神将恢复至满生命值。" this.goBtnText.text = "确定" elseif nodeState == ExpeditionNodeState.NoPass then this.content.text = "太上老君的炼丹炉,其中炼制着一颗能生死人肉白骨的神丹百转大还丹,可以随机复活一名阵亡的神将。如果没有阵亡的神将,则使一名随机神将恢复至满生命值。" this.goBtnText.text = "前往" end end end return this