【优化】抽将动画可以点击跳过
parent
3dfc48d652
commit
571a69888a
File diff suppressed because it is too large
Load Diff
|
@ -23,6 +23,9 @@ local heroStaticData
|
||||||
local testLiveGO
|
local testLiveGO
|
||||||
local maxTimesId--特权id上限(今日召唤上限)
|
local maxTimesId--特权id上限(今日召唤上限)
|
||||||
local _heroTable={} --符合4、5星的英雄容器
|
local _heroTable={} --符合4、5星的英雄容器
|
||||||
|
this.time = Timer.New()
|
||||||
|
this.time2 = Timer.New()
|
||||||
|
this.time3 = Timer.New()
|
||||||
--初始化组件(用于子类重写)
|
--初始化组件(用于子类重写)
|
||||||
function SingleRecruitPanel:InitComponent()
|
function SingleRecruitPanel:InitComponent()
|
||||||
orginLayer = 0
|
orginLayer = 0
|
||||||
|
@ -41,12 +44,13 @@ function SingleRecruitPanel:InitComponent()
|
||||||
self.dragView = SubUIManager.Open(SubUIConfig.DragView, self.gameObject.transform)
|
self.dragView = SubUIManager.Open(SubUIConfig.DragView, self.gameObject.transform)
|
||||||
self.dragView.transform:SetSiblingIndex(1)
|
self.dragView.transform:SetSiblingIndex(1)
|
||||||
this.rolePanel = Util.GetGameObject(self.transform, "rolePanel")
|
this.rolePanel = Util.GetGameObject(self.transform, "rolePanel")
|
||||||
|
this.jumpPanel = Util.GetGameObject(self.transform, "jumpPanel")
|
||||||
this.UI_Effect_open = Util.GetGameObject(self.transform, "bg/UI_Effect_open") --开门特效
|
this.UI_Effect_open = Util.GetGameObject(self.transform, "bg/UI_Effect_open") --开门特效
|
||||||
this.UI_Effect_appear = Util.GetGameObject(self.transform, "bg/UI_Effect_appear")
|
this.UI_Effect_appear = Util.GetGameObject(self.transform, "bg/UI_Effect_appear")
|
||||||
this.UI_Effect_choukaSSR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_SSR")
|
this.UI_Effect_choukaSSR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_SSR")
|
||||||
this.UI_Effect_choukaSR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_SR")
|
this.UI_Effect_choukaSR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_SR")
|
||||||
this.UI_Effect_choukaR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_R")
|
this.UI_Effect_choukaR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_R")
|
||||||
this.jumpBtn = Util.GetGameObject(self.transform, "rolePanel/jumpBtn")
|
this.jumpBtn = Util.GetGameObject(this.jumpPanel.transform, "btnContinue/jumpBtn")
|
||||||
self.posImage=Util.GetGameObject(self.transform,"Pos/PosImage"):GetComponent("Image")
|
self.posImage=Util.GetGameObject(self.transform,"Pos/PosImage"):GetComponent("Image")
|
||||||
self.posText=Util.GetGameObject(self.transform,"Pos/PosText"):GetComponent("Text")
|
self.posText=Util.GetGameObject(self.transform,"Pos/PosText"):GetComponent("Text")
|
||||||
|
|
||||||
|
@ -112,13 +116,19 @@ function SingleRecruitPanel:BindEvent()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
--十连跳过按钮 直接打开十连抽展示界面
|
--十连跳过按钮 直接打开十连抽展示界面
|
||||||
Util.AddClick(self.jumpBtn, function()
|
Util.AddClick(this.jumpBtn, function()
|
||||||
isFirst=true
|
isFirst=true
|
||||||
|
this.CloseAllTimer()
|
||||||
|
if state==1 then --单抽
|
||||||
|
this.UI_Effect_open:SetActive(false)
|
||||||
|
self:UpdataPanelData(heroData)
|
||||||
|
else
|
||||||
if lotterySetting[type].LotteryType == 11 then
|
if lotterySetting[type].LotteryType == 11 then
|
||||||
isFirst=false
|
isFirst=false
|
||||||
end
|
end
|
||||||
self:ClosePanel()
|
self:ClosePanel()
|
||||||
UIManager.OpenPanel(UIName.TenRecruitPanel,heroData,type,recruitType)
|
UIManager.OpenPanel(UIName.TenRecruitPanel,heroData,type,recruitType)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
--确定按钮
|
--确定按钮
|
||||||
Util.AddClick(self.goBtn,function()
|
Util.AddClick(self.goBtn,function()
|
||||||
|
@ -155,6 +165,7 @@ end
|
||||||
function SingleRecruitPanel:OnSortingOrderChange()
|
function SingleRecruitPanel:OnSortingOrderChange()
|
||||||
Util.AddParticleSortLayer(self.bg, self.sortingOrder - orginLayer)
|
Util.AddParticleSortLayer(self.bg, self.sortingOrder - orginLayer)
|
||||||
this.rolePanel:GetComponent("Canvas").sortingOrder = self.sortingOrder + 5
|
this.rolePanel:GetComponent("Canvas").sortingOrder = self.sortingOrder + 5
|
||||||
|
this.jumpPanel:GetComponent("Canvas").sortingOrder = self.sortingOrder + 10
|
||||||
orginLayer = self.sortingOrder
|
orginLayer = self.sortingOrder
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -178,11 +189,13 @@ function SingleRecruitPanel:OnShow()
|
||||||
maxTimesId=lotterySetting[type].MaxTimes --特权上限ID
|
maxTimesId=lotterySetting[type].MaxTimes --特权上限ID
|
||||||
index=0
|
index=0
|
||||||
if state==1 then --单抽
|
if state==1 then --单抽
|
||||||
|
this.jumpBtn:SetActive(true)
|
||||||
if lotterySetting[type].LotteryType == 11 then
|
if lotterySetting[type].LotteryType == 11 then
|
||||||
isFirst=false
|
isFirst=false
|
||||||
end
|
end
|
||||||
self:TenOpenPanel()
|
self:TenOpenPanel()
|
||||||
elseif state==2 then
|
elseif state==2 then
|
||||||
|
this.jumpBtn:SetActive(true)
|
||||||
isFirst=true
|
isFirst=true
|
||||||
if lotterySetting[type].LotteryType == 11 then
|
if lotterySetting[type].LotteryType == 11 then
|
||||||
isFirst=false
|
isFirst=false
|
||||||
|
@ -215,21 +228,22 @@ function SingleRecruitPanel:TenOpenPanel()
|
||||||
timeNum=0
|
timeNum=0
|
||||||
timeNum2=0
|
timeNum2=0
|
||||||
end
|
end
|
||||||
|
this.CloseAllTimer()
|
||||||
--当单抽 或者是 十连抽第一次的时候
|
--当单抽 或者是 十连抽第一次的时候
|
||||||
if state==1 or isFirst then
|
if state==1 or isFirst then
|
||||||
this.rolePanel:SetActive(false)
|
this.rolePanel:SetActive(false)
|
||||||
local time = Timer.New(function ()
|
this.time = Timer.New(function ()
|
||||||
this.UI_Effect_choukaSSR:SetActive(false)
|
this.UI_Effect_choukaSSR:SetActive(false)
|
||||||
this.UI_Effect_choukaSR:SetActive(false)
|
this.UI_Effect_choukaSR:SetActive(false)
|
||||||
this.UI_Effect_choukaR:SetActive(false)
|
this.UI_Effect_choukaR:SetActive(false)
|
||||||
this.UI_Effect_appear:SetActive(true)
|
this.UI_Effect_appear:SetActive(true)
|
||||||
SoundManager.PlaySound(SoundConfig.Sound_Recruit2)
|
SoundManager.PlaySound(SoundConfig.Sound_Recruit2)
|
||||||
end, timeNum)
|
end, timeNum)
|
||||||
time:Start()
|
this.time:Start()
|
||||||
local time3 = Timer.New(function ()
|
this.time3 = Timer.New(function ()
|
||||||
this.UI_Effect_open:SetActive(false)
|
this.UI_Effect_open:SetActive(false)
|
||||||
end, 4)
|
end, 4)
|
||||||
time3:Start()
|
this.time3:Start()
|
||||||
elseif state==2 then-- 十连抽
|
elseif state==2 then-- 十连抽
|
||||||
-- timeNum2=0
|
-- timeNum2=0
|
||||||
--this.UI_Effect_choukaSSR:SetActive(false)
|
--this.UI_Effect_choukaSSR:SetActive(false)
|
||||||
|
@ -237,7 +251,7 @@ function SingleRecruitPanel:TenOpenPanel()
|
||||||
--this.UI_Effect_choukaR:SetActive(false)
|
--this.UI_Effect_choukaR:SetActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
local time2 = Timer.New(function ()
|
this.time2 = Timer.New(function ()
|
||||||
if state==1 then
|
if state==1 then
|
||||||
self:UpdataPanelData(heroData)
|
self:UpdataPanelData(heroData)
|
||||||
else
|
else
|
||||||
|
@ -249,12 +263,13 @@ function SingleRecruitPanel:TenOpenPanel()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end, timeNum2)
|
end, timeNum2)
|
||||||
time2:Start()
|
this.time2:Start()
|
||||||
end
|
end
|
||||||
|
|
||||||
function SingleRecruitPanel:UpdataPanelData(_heroData)
|
function SingleRecruitPanel:UpdataPanelData(_heroData)
|
||||||
--赋值展示界面数据
|
--赋值展示界面数据
|
||||||
-- local time2 = Timer.New(function ()
|
-- local time2 = Timer.New(function ()
|
||||||
|
this.CloseAllTimer()
|
||||||
this.UI_Effect_appear:SetActive(false)
|
this.UI_Effect_appear:SetActive(false)
|
||||||
SoundManager.PlaySound(SoundConfig.Sound_Recruit3)
|
SoundManager.PlaySound(SoundConfig.Sound_Recruit3)
|
||||||
|
|
||||||
|
@ -342,7 +357,7 @@ function SingleRecruitPanel:UpdataPanelData(_heroData)
|
||||||
--10连
|
--10连
|
||||||
if state == 2 then
|
if state == 2 then
|
||||||
-- self:TenOpenPanel(heroData)
|
-- self:TenOpenPanel(heroData)
|
||||||
this.jumpBtn:SetActive(false)
|
this.jumpBtn:SetActive(true)
|
||||||
Util.GetGameObject(self.transform, "rolePanel/rolePanel2"):SetActive(true)
|
Util.GetGameObject(self.transform, "rolePanel/rolePanel2"):SetActive(true)
|
||||||
this.sureBtn:SetActive(false)
|
this.sureBtn:SetActive(false)
|
||||||
this.againBtn:SetActive(false)
|
this.againBtn:SetActive(false)
|
||||||
|
@ -357,17 +372,13 @@ function SingleRecruitPanel:UpdataPanelData(_heroData)
|
||||||
HeroManager.DetectionOpenFiveStarActivity(heroStaticData.Star)
|
HeroManager.DetectionOpenFiveStarActivity(heroStaticData.Star)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- end, timeNum2)
|
|
||||||
-- time2:Start()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function SingleRecruitPanel:OnClose()
|
function SingleRecruitPanel:OnClose()
|
||||||
_heroTable={}
|
_heroTable={}
|
||||||
index=0
|
index=0
|
||||||
if time ~= nil then
|
this.CloseAllTimer()
|
||||||
time:Stop()
|
|
||||||
end
|
|
||||||
if heroStaticData then
|
if heroStaticData then
|
||||||
poolManager:UnLoadLive(GetResourcePath(heroStaticData.Live), testLiveGO)
|
poolManager:UnLoadLive(GetResourcePath(heroStaticData.Live), testLiveGO)
|
||||||
end
|
end
|
||||||
|
@ -395,5 +406,19 @@ end
|
||||||
function SingleRecruitPanel:OnDestroy()
|
function SingleRecruitPanel:OnDestroy()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
function this.CloseAllTimer()
|
||||||
|
if this.time then
|
||||||
|
this.time:Stop()
|
||||||
|
this.time = nil
|
||||||
|
end
|
||||||
|
if this.time2 then
|
||||||
|
this.time2:Stop()
|
||||||
|
this.time2 = nil
|
||||||
|
end
|
||||||
|
if this.time3 then
|
||||||
|
this.time3:Stop()
|
||||||
|
this.time3 = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return SingleRecruitPanel
|
return SingleRecruitPanel
|
Loading…
Reference in New Issue