65 lines
1.8 KiB
Lua
65 lines
1.8 KiB
Lua
----- 招募二次确认弹窗 -----
|
|
local this = {}
|
|
--传入父脚本模块
|
|
local parent
|
|
--传入特效层级
|
|
local sortingOrder=0
|
|
|
|
local i
|
|
local func
|
|
|
|
function this:InitComponent(gameObject)
|
|
this.spLoader = SpriteLoader.New()
|
|
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
|
this.root = Util.GetGameObject(gameObject, "Root")
|
|
this.confirm = Util.GetGameObject(gameObject, "ConfirmBtn")
|
|
this.btn=Util.GetGameObject(this.root,"Btn1")
|
|
this.rootText=Util.GetGameObject(this.root,"Text"):GetComponent("Text")
|
|
this.go = Util.GetGameObject(this.root,"Btn1/Go")
|
|
end
|
|
|
|
function this:BindEvent()
|
|
Util.AddClick(this.confirm,function()
|
|
PlayerPrefs.SetInt(PlayerManager.uid.."GeneralPopup_EndlessSettingBtn",this.click)
|
|
parent:ClosePanel()
|
|
if func then
|
|
func()
|
|
end
|
|
end)
|
|
Util.AddClick(this.btn,function()
|
|
this.click = (this.click == 1) and 0 or 1
|
|
this.go:SetActive(this.click == 1)
|
|
end)
|
|
end
|
|
|
|
function this:AddListener()
|
|
end
|
|
|
|
function this:RemoveListener()
|
|
end
|
|
|
|
function this:OnShow(_parent,...)
|
|
parent=_parent
|
|
sortingOrder = _parent.sortingOrder
|
|
this.rootText.text = "无尽副本中的怪物阵容搭配丰富,跳过战斗会降低游戏乐趣"
|
|
this.click = 0
|
|
if PlayerPrefs.HasKey(PlayerManager.uid.."GeneralPopup_EndlessSettingBtn") then
|
|
local t = PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_EndlessSettingBtn")
|
|
this.go:SetActive(t == 1)
|
|
this.click = t
|
|
else
|
|
this.click = 0
|
|
this.go:SetActive(false)
|
|
end
|
|
PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_EndlessSettingBtn")
|
|
end
|
|
|
|
function this:OnClose()
|
|
end
|
|
|
|
function this:OnDestroy()
|
|
this.spLoader:Destroy()
|
|
this.btn={}
|
|
end
|
|
|
|
return this |