【优化】抽将动画可以点击跳过

dev_chengFeng
zhangqiang 2021-01-26 18:52:03 +08:00
parent 3dfc48d652
commit 571a69888a
2 changed files with 96776 additions and 96522 deletions

View File

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