lingshou zhaohuan tijiao

jiaoyangna 2020-11-05 03:03:08 +08:00
parent a39bc32ef6
commit da88485b4c
8 changed files with 235681 additions and 17034 deletions

View File

@ -200,6 +200,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 133871731866382050}
- {fileID: 7357582473762033002} - {fileID: 7357582473762033002}
- {fileID: 5402362866070119408} - {fileID: 5402362866070119408}
- {fileID: 6817404965073036329} - {fileID: 6817404965073036329}
@ -209,7 +210,6 @@ RectTransform:
- {fileID: 6076006563234951857} - {fileID: 6076006563234951857}
- {fileID: 3252162807217255882} - {fileID: 3252162807217255882}
- {fileID: 4393464194978702593} - {fileID: 4393464194978702593}
- {fileID: 133871731866382050}
- {fileID: 6958190212726748315} - {fileID: 6958190212726748315}
- {fileID: 4586412814992109867} - {fileID: 4586412814992109867}
m_Father: {fileID: 0} m_Father: {fileID: 0}
@ -325,7 +325,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 2 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -404,7 +404,7 @@ RectTransform:
- {fileID: 8140004460555323162} - {fileID: 8140004460555323162}
- {fileID: 5792920245874615388} - {fileID: 5792920245874615388}
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 8 m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1366,7 +1366,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 5 m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1487,7 +1487,7 @@ RectTransform:
- {fileID: 8042624082910741880} - {fileID: 8042624082910741880}
- {fileID: 5344970607808354557} - {fileID: 5344970607808354557}
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 7 m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1593,7 +1593,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 6 m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1668,7 +1668,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 4 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1784,7 +1784,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1863,7 +1863,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 0 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1938,7 +1938,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 4930053279089642074} - {fileID: 4930053279089642074}
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 3 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -2261,13 +2261,13 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 5693075236157895772} m_Father: {fileID: 5693075236157895772}
m_RootOrder: 9 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -437.47, y: -858.85944} m_AnchoredPosition: {x: 0, y: 97}
m_SizeDelta: {x: 143.3, y: 122.65} m_SizeDelta: {x: 140, y: 121}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0, y: 0.5}
--- !u!222 &5022890421189793496 --- !u!222 &5022890421189793496
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -1851,6 +1851,9 @@ RecruitType = {
NormalTen=25, --普通招募 多次 NormalTen=25, --普通招募 多次
NormalSingle=26, --普通招募 单次 NormalSingle=26, --普通招募 单次
RecruitBox=27,--仙缘招募 RecruitBox=27,--仙缘招募
LingShowSingle = 42, --零售单抽
LingShowTen = 43, --零售十连
-- FindFairySingle=13, --东海寻仙单抽 -- FindFairySingle=13, --东海寻仙单抽
-- FindFairyTen=14, --东海寻仙十连 -- FindFairyTen=14, --东海寻仙十连
} }

View File

@ -1,68 +1,75 @@
require("Base/BasePanel") require("Base/BasePanel")
PokemonSummonOneResultPanel = Inherit(BasePanel) PokemonSummonOneResultPanel = Inherit(BasePanel)
local this=PokemonSummonOneResultPanel local this=PokemonSummonOneResultPanel
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) local heroConfigData = ConfigManager.GetConfig(ConfigName.SpiritAnimal)
local gameSetting=ConfigManager.GetConfig(ConfigName.GameSetting) local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local lotterySetting = ConfigManager.GetConfig(ConfigName.LotterySetting)
local iconsData = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotteryRewardConfig,"Pool",4401)
local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local itemNum=0 --抽卡小号道具数量 local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local isFree=false local passiveSkillConfig=ConfigManager.GetConfig(ConfigName.SpiritAnimalSkill)
--活动抽卡类型(动态的数据)
local drawtType={ local isFirst = true--是否为第一次进入界面
FindFairySingle=0, local timeNum--第一个特效等待播放的时间
} local timeNum2--第二个特效等待播放的时间
local timeNum3--第三个特效等待播放的时间
local heroData--展示界面需要的单个英雄数据
local type --抽卡类型
local state --1单抽 2多抽
local index=0 --十连抽索引
local orginLayer local orginLayer
local heroStaticData
local testLiveGO
local maxTimesId--特权id上限今日召唤上限
local _heroTable={} --符合4、5星的英雄容器
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
function PokemonSummonOneResultPanel:InitComponent() function PokemonSummonOneResultPanel:InitComponent()
orginLayer = 10 orginLayer = 0
self.bg = Util.GetGameObject(self.gameObject, "effect") this.bg = Util.GetGameObject(self.gameObject, "bg")
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft, panelType = PanelType.ElementDrawCard }) screenAdapte(this.bg)
screenAdapte(self.bg) this.rolePanel = Util.GetGameObject(self.transform, "rolePanel")
this.btnBack=Util.GetGameObject(self.gameObject, "bottom/backButton") this.live2dRoot = Util.GetGameObject(this.rolePanel, "live2dRoot")
this.content=Util.GetGameObject(self.gameObject, "content") this.heroName = Util.GetGameObject(this.rolePanel, "rolePanel1/Panel/name"):GetComponent("Text")
this.openOneAgainButton=Util.GetGameObject(self.gameObject, "bottom/openOneAgainButton") this.Title = Util.GetGameObject(this.rolePanel, "rolePanel1/Panel/Title"):GetComponent("Text")
this.detailImage=Util.GetGameObject(self.gameObject, "Tip") this.icon = Util.GetGameObject(this.rolePanel, "rolePanel1/Panel/info/frame/icon"):GetComponent("Image")
this.detailText = Util.GetGameObject(this.detailImage, "Text"):GetComponent("Text") this.content = Util.GetGameObject(this.rolePanel, "rolePanel1/Panel/info/content"):GetComponent("Text")
this.content1=Util.GetGameObject(self.gameObject,"bottom/openOneAgainButton/Content1")
this.itemIcon1=Util.GetGameObject(this.content1, "Icon"):GetComponent("Image") this.goBtn=Util.GetGameObject(this.rolePanel,"rolePanel2/goBtn")
this.detailImage1=Util.GetGameObject(this.content1, "Tip") this.sureBtn = Util.GetGameObject(this.rolePanel, "rolePanel2/sureBtn")
this.detailText1 = Util.GetGameObject(this.detailImage1, "contentDetailText"):GetComponent("Text") this.againBtn = Util.GetGameObject(this.rolePanel, "rolePanel2/againBtn")
this.content3=Util.GetGameObject(self.gameObject,"bottom/openOneAgainButton/Content3")
this.itemIcon3=Util.GetGameObject(this.content3, "icon"):GetComponent("Image") this.againIcon=Util.GetGameObject(self.againBtn,"Tip/juan"):GetComponent("Image")
this.itemNum3=Util.GetGameObject(this.content3, "num"):GetComponent("Text") this.againNum=Util.GetGameObject(self.againBtn,"Tip/Text"):GetComponent("Text")
this.itemInfo3=Util.GetGameObject(this.content3, "info"):GetComponent("Text")
this.content2=Util.GetGameObject(self.gameObject,"bottom/openOneAgainButton/Content2") this.UI_Effect_open = Util.GetGameObject(self.transform, "bg/UI_Effect_open") --开门特效
this.itemIcon2=Util.GetGameObject(this.content2, "Icon"):GetComponent("Image") this.UI_Effect_appear = Util.GetGameObject(self.transform, "bg/UI_Effect_appear")
this.itemNum2=Util.GetGameObject(this.content2,"Num"):GetComponent("Text") this.UI_Effect_choukaSSR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_SSR")
-- 关于抽卡的LotterySetting数据 this.UI_Effect_choukaSR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_SR")
local curActivityId=ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.QianKunBox) this.UI_Effect_choukaR = Util.GetGameObject(self.transform, "bg/UI_Effect_chouka_R")
drawtType.FindFairySingle=ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"PerCount",1,"ActivityId",curActivityId).Id
end end
--绑定事件(用于子类重写) --绑定事件(用于子类重写)
function PokemonSummonOneResultPanel:BindEvent() function PokemonSummonOneResultPanel:BindEvent()
Util.AddClick(self.sureBtn, function()
Util.AddClick(this.btnBack, function () isFirst=true
self:ClosePanel() self:ClosePanel()
end) end)
Util.AddClick(this.openOneAgainButton, function () Util.AddClick(self.againBtn, function()
local maxtimesId=lotterySetting[this.recruitType].MaxTimes
local freeTimesId=lotterySetting[this.recruitType].FreeTimes end)
if(isFree or BagManager.GetItemCountById(1204)>=1 or BagManager.GetItemCountById(16)>=itemNum) then --确定按钮
self:ClosePanel() Util.AddClick(self.goBtn,function()
RecruitManager.RecruitRequest(this.recruitType, function(msg) if state==1 then
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,1)--记录抽卡次数 this.goBtn:SetActive(false)
UIManager.OpenPanel(UIName.PokemonSummonOneResultPanel,msg.drop,this.recruitType) this.againBtn:SetActive(true)
CheckRedPointStatus(RedPointType.QianKunBox) this.sureBtn:SetActive(true)
end,freeTimesId) elseif state==2 then
else if index>=LengthOfTable(_heroTable) then
--UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.DemonCrystal })--应跳到充值界面,现在是用之前的货币换取妖晶 isFirst=true
PopupTipPanel.ShowTip(Language[11139]) self:ClosePanel()
self:ClosePanel() UIManager.OpenPanel(UIName.TenRecruitPanel,heroData,type)
else
self:TenOpenPanel(heroData)
end
end end
end) end)
end end
@ -78,95 +85,175 @@ function PokemonSummonOneResultPanel:RemoveListener()
end end
function PokemonSummonOneResultPanel:OnSortingOrderChange() function PokemonSummonOneResultPanel:OnSortingOrderChange()
Util.AddParticleSortLayer(self.bg, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.bg, self.sortingOrder - orginLayer)
this.rolePanel:GetComponent("Canvas").sortingOrder = self.sortingOrder + 5
orginLayer = self.sortingOrder orginLayer = self.sortingOrder
if this.view then
this.view:OnOpen(true,this.itemDataList[1],1.4,true,false,false,self.sortingOrder)
end
end end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
function PokemonSummonOneResultPanel:OnOpen(...) function PokemonSummonOneResultPanel:OnOpen(...)
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.LingShou}) this.UI_Effect_open:SetActive(true)
SoundManager.PlaySound(SoundConfig.Sound_Recruit1)
this.UI_Effect_choukaSSR:SetActive(false)
this.UI_Effect_choukaSR:SetActive(false)
this.UI_Effect_choukaR:SetActive(false)
this.UI_Effect_appear:SetActive(false)
this.rolePanel:SetActive(false)
local args = { ... } local args = { ... }
this.drop=args[1] heroData = args[1]
this.recruitType = args[2] type = args[2]
this.detailImage:SetActive(true) state = args[3]
this.content1:SetActive(false) end
this.content2:SetActive(false)
this.content3:SetActive(true) function PokemonSummonOneResultPanel:OnShow()
local itemId=0 maxTimesId = lotterySetting[type].MaxTimes --特权上限ID
local d index=0
d = RecruitManager.GetExpendData(this.recruitType) if state==1 then --单抽
itemId=d[1] self:TenOpenPanel()
itemNum=d[2] elseif state == 2 then
this.itemIcon3.sprite=Util.LoadSprite(artResourcesConfig[ItemConfig[itemId].ResourceID].Name) isFirst=true
--是否激活特权 _heroTable={}
local isActive = PrivilegeManager.GetPrivilegeOpenStatusById(3004) --将符合条件的英雄插入容器中
if itemNum>10 and isActive then for k, v in ipairs(heroData) do
itemNum=itemNum*(1+currPrivilege.Condition[1][2]/10000) if heroConfigData[v.heroId].Star==4 or heroConfigData[v.heroId].Star==5 then
end -- LogBlue(heroConfigData[v.heroId].ReadingName)
--获取免费次数 table.insert(_heroTable,v)
local currLottery= ConfigManager.GetConfigData(ConfigName.LotterySetting,42)
local freeTimesId=currLottery.FreeTimes
local freeTime=0
if freeTimesId>0 then
freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId]=freeTime
end
isFree=freeTime and freeTime >= 1
if isFree then
this.itemNum3.gameObject:SetActive(false)
this.itemIcon3.gameObject:SetActive(false)
this.itemInfo3.text=Language[12399]
else
this.itemNum3.gameObject:SetActive(true)
this.itemIcon3.gameObject:SetActive(true)
this.itemInfo3.text=Language[12418]
end
this.itemNum3.text= tostring(itemNum)
Util.ClearChild(Util.GetTransform(this.content, "itemContent1"))
this.itemDataList={}
this.itemDataList=BagManager.GetTableByBackDropData(this.drop)
--抽奖赠送物品
local tenConfig=lotterySetting[42]
local id=0
local num=0
local ishave=false
if tenConfig then
id=tenConfig.TenTimesMustGetItem[1][1]
num=tenConfig.TenTimesMustGetItem[1][2]
end
for key, value in pairs(this.itemDataList) do
if ishave==false and value.sId==id and value.num==num then
table.removebyvalue(this.itemDataList,value)
ishave=true
end
end
this.detailText.text = string.format("赠送%s个%s",num,ItemConfig[id].Name)
this.view = SubUIManager.Open(SubUIConfig.ItemView,Util.GetTransform(this.content, "itemContent1"))
this.view:OnOpen(true,this.itemDataList[1],1.4,true,false,false,self.sortingOrder)
this.openOneAgainButton:GetComponent("Button").enabled=false
local time = Timer.New(function ()
this.openOneAgainButton:GetComponent("Button").enabled=true
local itemDataList=BagManager.GetTableByBackDropData(this.drop)
if itemDataList and #itemDataList>0 then
local singleItemConfigData=itemDataList[1].configData
if singleItemConfigData and singleItemConfigData.ItemType==4 and singleItemConfigData.Quantity>=gameSetting[1].IfVersion then
UIManager.OpenPanel(UIName.SecretBoxShowPokemonPanel,singleItemConfigData.Id)
end end
end end
end, 0.5) -- LogGreen("符合条件的英雄数量"..LengthOfTable(_heroTable))
time:Start() self:TenOpenPanel()
end
end end
--界面关闭时调用(用于子类重写)
local time--十连抽每次展示特效time
function PokemonSummonOneResultPanel:TenOpenPanel()
if isFirst then --第一次进来
this.UI_Effect_open:SetActive(true)
index=1
timeNum3=0
timeNum=1.3
timeNum2=4.3
else--以后每次进来
this.UI_Effect_open:SetActive(false)
index=index+1
timeNum3=2
timeNum=0
timeNum2=0
end
--当单抽 或者是 十连抽第一次的时候
if state==1 or isFirst then
this.rolePanel:SetActive(false)
local 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.UI_Effect_open:SetActive(false)
end, 4)
time3:Start()
elseif state==2 then-- 十连抽
-- timeNum2=0
--this.UI_Effect_choukaSSR:SetActive(false)
--this.UI_Effect_choukaSR:SetActive(false)
--this.UI_Effect_choukaR:SetActive(false)
end
local time2 = Timer.New(function ()
if state==1 then
self:UpdataPanelData(heroData)
else
if LengthOfTable(_heroTable)>0 then
self:UpdataPanelData(_heroTable[index])
else
self:ClosePanel()
UIManager.OpenPanel(UIName.TenRecruitPanel,heroData,type)
end
end
end, timeNum2)
time2:Start()
end
function PokemonSummonOneResultPanel:UpdataPanelData(_heroData)
--赋值展示界面数据
-- local time2 = Timer.New(function ()
this.UI_Effect_appear:SetActive(false)
SoundManager.PlaySound(SoundConfig.Sound_Recruit3)
if heroStaticData and testLiveGO then
poolManager:UnLoadLive(GetResourcePath(heroStaticData.Live), testLiveGO)
heroStaticData, testLiveGO = nil, nil
end
heroStaticData = heroConfigData[_heroData.pokemonId]
LogBlue("heroStaticData.Live:"..heroStaticData.Live)
--不同星级开启不同特效
this.UI_Effect_choukaSSR:SetActive(true)
--TODO:动态加载立绘
testLiveGO = poolManager:LoadLive(GetResourcePath(heroStaticData.Live), self.live2dRoot.transform,
Vector3.one * heroStaticData.Scale, Vector3.New(heroStaticData.Position[1],heroStaticData.Position[2],0))
local SkeletonGraphic = testLiveGO:GetComponent("SkeletonGraphic")
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
poolManager:SetLiveClearCall(GetResourcePath(heroStaticData.Live), testLiveGO, function ()
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idle
end)
this.heroName.text = heroStaticData.Name
this.Title = heroStaticData.Description
this.icon.sprite=Util.LoadSprite(artResourcesConfig(heroStaticData.Icon))
this.content.text = passiveSkillConfig[heroStaticData.SkillArray[1][2]].Desc
local d = RecruitManager.GetExpendData(type)
--如果当前是用妖晶抽卡 and 激活了特权
local isActive = PrivilegeManager.GetPrivilegeOpenStatusById(3004)
local itemNum = d[2]
if d[1] == 16 and isActive then
local currPrivilege = privilegeConfig[3004]
if currPrivilege then
itemNum = itemNum * (1 + currPrivilege.Condition[1][2]/10000)
end
end
self.againIcon.sprite=Util.LoadSprite(artResourcesConfig[itemConfig[d[1]].ResourceID].Name)
self.againNum.text="×"..d[2]
this.rolePanel:SetActive(true)
PlayUIAnim(self.transform)
isFirst=false
--10连
if state == 2 then
-- self:TenOpenPanel(heroData)
Util.GetGameObject(self.transform, "rolePanel/rolePanel2"):SetActive(true)
this.sureBtn:SetActive(false)
this.againBtn:SetActive(false)
this.goBtn:SetActive(true)
else
this.goBtn:SetActive(true)
this.sureBtn:SetActive(false)
this.againBtn:SetActive(false)
Util.GetGameObject(self.transform, "rolePanel/rolePanel2"):SetActive(true)
end
end
function PokemonSummonOneResultPanel:OnClose() function PokemonSummonOneResultPanel:OnClose()
_heroTable={}
index=0
if time ~= nil then
time:Stop()
time = nil
end
if heroStaticData then
poolManager:UnLoadLive(GetResourcePath(heroStaticData.Live), testLiveGO)
end
heroStaticData, testLiveGO = nil, nil
end end
--界面销毁时调用(用于子类重写)
function PokemonSummonOneResultPanel:OnDestroy() function PokemonSummonOneResultPanel:OnDestroy()
SubUIManager.Close(this.UpView)
this.view = nil
end end
return PokemonSummonOneResultPanel return PokemonSummonOneResultPanel

View File

@ -7,38 +7,38 @@ local bType={
} }
--type与lotterySetting表中的id对应 --type与lotterySetting表中的id对应
local btns={ [bType.Btn1]={name="Btn1",isInfo=Language[10644]}, [bType.Btn10]={name="Btn10",isInfo=Language[12182]}} local btns={ [bType.Btn1]={name="Btn1",isInfo=Language[10644]}, [bType.Btn10]={name="Btn10",isInfo=Language[12182]}}
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting) local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig) local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local lotterySpecialConfig = ConfigManager.GetConfig(ConfigName.LotterySpecialConfig) local lotterySpecialConfig = ConfigManager.GetConfig(ConfigName.LotterySpecialConfig)
local freeTime= 0 --免费抽取次数 local freeTime= 0 --免费抽取次数
local isActive=false --是否激活特权 local isActive=false --是否激活特权
local leftTime=0 --特权剩余时间 local leftTime=0 --特权剩余时间
function PokemonSummonPanel:InitComponent(gameObject) function PokemonSummonPanel:InitComponent(gameObject)
self.btn_back=Util.GetGameObject(self.transform, "btn_back") self.btn_back=Util.GetGameObject(self.transform, "btn_back")
self.buffImg=Util.GetGameObject(self.transform, "tokenImg"):GetComponent("Image") self.buffImg=Util.GetGameObject(self.transform, "tokenImg"):GetComponent("Image")
self.leftTimeObj=Util.GetGameObject(self.transform, "leftTimeObj")
self.upView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft})
self.leftTimeTxt=Util.GetGameObject(self.transform,"leftTimeObj/leftTimeTxt"):GetComponent("Text")
self.infoTxt=Util.GetGameObject(self.transform,"hint"):GetComponent("Text") self.infoTxt=Util.GetGameObject(self.transform,"hint"):GetComponent("Text")
self.leftTimeObj=Util.GetGameObject(self.transform, "leftTimeObj")
self.leftTimeTxt=Util.GetGameObject(self.transform,"leftTimeObj/leftTimeTxt"):GetComponent("Text")
self.btn_shop=Util.GetGameObject(self.transform,"btn_shop") self.btn_shop=Util.GetGameObject(self.transform,"btn_shop")
self.btn_reward=Util.GetGameObject(self.transform,"btn_rewardPool")
self.btn_one=Util.GetGameObject(self.transform,"Btn1")
self.oneHintTxt=Util.GetGameObject(self.btn_one,"Tip"):GetComponent("Text")
self.btn_ten=Util.GetGameObject(self.transform,"Btn10")
self.tenHintTxt=Util.GetGameObject(self.btn_ten,"Tip"):GetComponent("Text")
self.btn_activate=Util.GetGameObject(self.transform,"btn_activate") self.btn_activate=Util.GetGameObject(self.transform,"btn_activate")
Util.GetGameObject(self.btn_activate,"Text"):GetComponent("Text").text=Language[12411] Util.GetGameObject(self.btn_activate,"Text"):GetComponent("Text").text=Language[12411]
self.btn_reward=Util.GetGameObject(self.transform,"btn_rewardPool")
self.btn_one=Util.GetGameObject(self.transform,"Btn1") self.limitTxt=Util.GetGameObject(self.transform,"limit"):GetComponent("Text")
self.btn_ten=Util.GetGameObject(self.transform,"Btn10") self.upView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft})
self.limitTxt=Util.GetGameObject(self.transform,"limit"):GetComponent("Text")
self.oneTxt=Util.GetGameObject(self.transform,"Btn1/Content/Info"):GetComponent("Text")
self.oneImg=Util.GetGameObject(self.transform,"Btn1/Content/Icon"):GetComponent("Image")
self.oneNumTxt=Util.GetGameObject(self.transform,"Btn1/Content/Num"):GetComponent("Text")
self.oneHintTxt=Util.GetGameObject(self.transform,"Btn1/Tip"):GetComponent("Text")
self.oneRedPoint=Util.GetGameObject(self.transform,"Btn1/RedPoint")
self.tenTxt=Util.GetGameObject(self.transform,"Btn10/Content/Info"):GetComponent("Text")
self.tenImg=Util.GetGameObject(self.transform,"Btn10/Content/Icon"):GetComponent("Image")
self.tenNumTxt=Util.GetGameObject(self.transform,"Btn10/Content/Num"):GetComponent("Text")
self.tenHintTxt=Util.GetGameObject(self.transform,"Btn10/Tip"):GetComponent("Text")
end end
function PokemonSummonPanel:BindEvent() function PokemonSummonPanel:BindEvent()
@ -58,7 +58,7 @@ function PokemonSummonPanel:BindEvent()
end) end)
Util.AddClick(self.btn_back,function() Util.AddClick(self.btn_back,function()
UIManager.ClosePanel(UIName.PokemonSummonPanel) self:ClosePanel()
end) end)
Util.AddClick(self.btn_activate,function() Util.AddClick(self.btn_activate,function()
--激活特权 --激活特权
@ -66,10 +66,9 @@ function PokemonSummonPanel:BindEvent()
end) end)
end end
function PokemonSummonPanel:OnShow(sortingOrder,_parent) function PokemonSummonPanel:OnShow()
parent = _parent
orginLayer = sortingOrder
self.upView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.LingShou}) self.upView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.LingShou})
self.infoTxt.text=Language[12415] self.infoTxt.text=Language[12415]
--是否显示特权 --是否显示特权
isActive = PrivilegeManager.GetPrivilegeOpenStatusById(3004) isActive = PrivilegeManager.GetPrivilegeOpenStatusById(3004)
@ -84,117 +83,140 @@ function PokemonSummonPanel:OnShow(sortingOrder,_parent)
self.leftTimeObj.gameObject:SetActive(false) self.leftTimeObj.gameObject:SetActive(false)
self.btn_activate.gameObject:SetActive(true) self.btn_activate.gameObject:SetActive(true)
end end
self:refreshMagicNum()
self:refreshBtnShow()--刷新按钮显示 self:refreshBtnShow()--刷新按钮显示
self:timeCountDown()--时间 self:timeCountDown()--时间
end end
function PokemonSummonPanel:refreshBtnShow() function PokemonSummonPanel:refreshBtnShow()
--显示 local currLottery = ConfigManager.GetConfigData(ConfigName.LotterySetting,RecruitType.LingShowSingle)
local array = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySetting,"LotteryType",9) local freeTimesId = currLottery.FreeTimes
singleRecruit = array[1] local maxtimesId = currLottery.MaxTimes --lotterySetting表中的MaxTimes对应privilegeConfig表中的id
tenRecruit = array[2] local curTimes = PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)
local currLottery= ConfigManager.GetConfigData(ConfigName.LotterySetting,42) self.tenHintTxt.text=string.format("妖晶召唤次数:%s/%s",PrivilegeManager.GetPrivilegeUsedTimes(2006), privilegeConfig[2006].Condition[1][2])
local freeTimesId=currLottery.FreeTimes
local maxtimesId=currLottery.MaxTimes --lotterySetting表中的MaxTimes对应privilegeConfig表中的id
local curTimes=PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)
self.tenHintTxt.text=string.format("妖晶召唤次数:%s/%s",0, privilegeConfig[2006].Condition[1][2])
self.limitTxt.text = Language[12225]..curTimes.."/"..privilegeConfig[maxtimesId].Condition[1][2] self.limitTxt.text = Language[12225]..curTimes.."/"..privilegeConfig[maxtimesId].Condition[1][2]
if freeTimesId>0 then if freeTimesId > 0 then
freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId) freeTime = PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId]=freeTime RecruitManager.freeUseTimeList[freeTimesId] = freeTime
end end
--按钮赋值 --按钮赋值
for n, m in ipairs(btns) do for n, m in ipairs(btns) do
local btn=Util.GetGameObject(self.gameObject,m.name) local btn = Util.GetGameObject(self.gameObject,m.name)
local redPot=Util.GetGameObject(btn.gameObject,"RedPoint") local redPot = Util.GetGameObject(btn.gameObject,"RedPoint")
local info=Util.GetGameObject(btn.gameObject,"Content/Info"):GetComponent("Text") local info = Util.GetGameObject(btn.gameObject,"Content/Info"):GetComponent("Text")
local icon=Util.GetGameObject(btn.gameObject,"Content/Icon"):GetComponent("Image") local icon = Util.GetGameObject(btn.gameObject,"Content/Icon"):GetComponent("Image")
local num=Util.GetGameObject(btn.gameObject,"Content/Num"):GetComponent("Text") local num = Util.GetGameObject(btn.gameObject,"Content/Num"):GetComponent("Text")
local tip=Util.GetGameObject(btn.gameObject,"Tip"):GetComponent("Text") local tip = Util.GetGameObject(btn.gameObject,"Tip"):GetComponent("Text")
--存在免费次数 并且 免费>=1 并且是1按钮 --存在免费次数 并且 免费>=1 并且是1按钮
local isFree=freeTime and freeTime >= 1 and n==bType.Btn1 local isFree = freeTime and freeTime >= 1 and n == bType.Btn1
redPot.gameObject:SetActive(isFree) redPot.gameObject:SetActive(isFree)
icon.gameObject:SetActive(not isFree) icon.gameObject:SetActive(not isFree)
num.gameObject:SetActive(not isFree) num.gameObject:SetActive(not isFree)
local itemId=0 local itemId=0
local itemNum=0 local itemNum=0
local type = 0 local type = 0
if n==bType.Btn1 then if n == bType.Btn1 then
type = singleRecruit.Id type = currLottery.Id
else else
type = tenRecruit.Id type = ConfigManager.GetConfigData(ConfigName.LotterySetting,RecruitType.LingShowTen).Id
end end
local d=RecruitManager.GetExpendData(type) local d = RecruitManager.GetExpendData(type)
if isFree then if isFree then
info.text=Language[11759] info.text=Language[11759]
else else
itemId=d[1] itemId = d[1]
itemNum=d[2] itemNum = d[2]
--如果当前是用妖晶抽卡 and 激活了特权 --如果当前是用妖晶抽卡 and 激活了特权
if itemNum>10 and isActive then if itemId == 16 and isActive then
local currPrivilege=privilegeConfig[3004] local currPrivilege = privilegeConfig[3004]
if currPrivilege then if currPrivilege then
itemNum=itemNum*(1+currPrivilege.Condition[1][2]/10000) itemNum = itemNum * (1 + currPrivilege.Condition[1][2]/10000)
end end
end end
icon.sprite=Util.LoadSprite(artResourcesConfig[itemConfig[itemId].ResourceID].Name) icon.sprite = Util.LoadSprite(artResourcesConfig[itemConfig[itemId].ResourceID].Name)
info.text=m.isInfo info.text = m.isInfo
num.text= tostring(itemNum) num.text = tostring(itemNum)
end end
Util.AddOnceClick(btn,function() Util.AddOnceClick(btn,function()
if not isFree then local state = PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.LingShowTen)
if BagManager.GetItemCountById(itemId)<d[2] then if n == bType.Btn1 then
PopupTipPanel.ShowTip(itemConfig[itemId].Name..Language[10492]) if isFree then
return self:Recruit(RecruitType.LingShowSingle,maxtimesId,0,0,state,freeTimesId)
end
end
local state = PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.QianKunBoxTen)
if n==bType.Btn1 then
if PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)+1>privilegeConfig[maxtimesId].Condition[1][2] then
PopupTipPanel.ShowTip(Language[11760])
return
end
local recruitOne = function()
RecruitManager.RecruitRequest(singleRecruit.Id, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,1)--记录抽卡次数
UIManager.OpenPanel(UIName.PokemonSummonOneResultPanel, msg.drop,singleRecruit.Id)
CheckRedPointStatus(RedPointType.QianKunBox)
end,freeTimesId)
end
if state==0 and d[1] ==16 and not isFree then
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitConfirm,singleRecruit.Id,recruitOne)
else else
recruitOne() self:Recruit(RecruitType.LingShowSingle,maxtimesId,itemId,itemNum,state,freeTimesId)
end end
elseif n==bType.Btn10 then elseif n==bType.Btn10 then
if PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)+10>privilegeConfig[maxtimesId].Condition[1][2] then self:Recruit(RecruitType.LingShowTen,maxtimesId,itemId,itemNum,state,freeTimesId)
PopupTipPanel.ShowTip(Language[11760])
return
end
local recruitTen = function()
RecruitManager.RecruitRequest(tenRecruit.Id, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,10)--记录抽卡次数
UIManager.OpenPanel(UIName.PokemonSummonTenResultPanel, msg.drop,tenRecruit.Id)
CheckRedPointStatus(RedPointType.QianKunBox)
end,freeTimesId)
end
if state==0 and d[1] ==16 and not isFree then
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitConfirm,tenRecruit.Id,recruitTen)
else
recruitTen()
end
end end
end) end)
end end
end end
function PokemonSummonPanel:Recruit(id,RecruitMaxtimesId,itemId,itemNum,state,freeTimesId)
local num = 0
if id == RecruitType.LingShowSingle then
num = 1
else
num = 10
end
--是否超过每日最大上限
if PrivilegeManager.GetPrivilegeUsedTimes(RecruitMaxtimesId) + num > privilegeConfig[RecruitMaxtimesId].Condition[1][2] then
PopupTipPanel.ShowTip(Language[11760])
return
end
--是否妖晶,是否超过每日妖晶最大上限
if itemId == 16 then
if PrivilegeManager.GetPrivilegeUsedTimes(2006) + num > privilegeConfig[2006].Condition[1][2] then
PopupTipPanel.ShowTip("今日妖晶召唤次数不足!")
return
end
end
if itemId ~= 0 then
if BagManager.GetItemCountById(itemId) < itemNum then
PopupTipPanel.ShowTip(itemConfig[itemId].Name..Language[10492])
return
end
end
if itemId == 16 and state == 0 then
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitConfirm,id,
function()
RecruitManager.RecruitRequest(id,
function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(RecruitMaxtimesId,num)--记录抽卡次数
PrivilegeManager.RefreshPrivilegeUsedTimes(2006,num)--记录妖晶抽卡次数
if num == 1 then
UIManager.OpenPanel(UIName.PokemonSummonOneResultPanel, msg.drop.pokemon[1],id,1)
else
UIManager.OpenPanel(UIName.PokemonSummonTenResultPanel, msg.drop.pokemon,id,2)
end
--CheckRedPointStatus(RedPointType.QianKunBox)
end,
freeTimesId,itemId,itemNum)
end,
itemNum)
else
RecruitManager.RecruitRequest(id, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(RecruitMaxtimesId,num)--记录抽卡次数
if itemId == 16 then
PrivilegeManager.RefreshPrivilegeUsedTimes(2006,num)--记录妖晶抽卡次数
end
if num == 1 then
UIManager.OpenPanel(UIName.PokemonSummonOneResultPanel, msg.drop.pokemon[1],id,1)
else
UIManager.OpenPanel(UIName.PokemonSummonTenResultPanel, msg.drop.pokemon,id,2)
end
--CheckRedPointStatus(RedPointType.QianKunBox)
end,freeTimesId,itemId,itemNum)
end
end
--商店 --商店
function PokemonSummonPanel:storeShow() function PokemonSummonPanel:storeShow()
if not self.shopView then if not self.shopView then
self.shopView = SubUIManager.Open(SubUIConfig.ShopView, self.content.transform) self.shopView = SubUIManager.Open(SubUIConfig.ShopView, self.content.transform)
end end
self.shopView:ShowShop(SHOP_TYPE.QIANKUNBOX_SHOP,orginLayer) self.shopView:ShowShop(SHOP_TYPE.QIANKUNBOX_SHOP)
end end
--时间 --时间
@ -202,8 +224,7 @@ function PokemonSummonPanel:timeCountDown()
if freeTime>0 then if freeTime>0 then
self.oneHintTxt.text=string.format(Language[12400],freeTime) self.oneHintTxt.text=string.format(Language[12400],freeTime)
else else
local timeDown=CalculateSecondsNowTo_N_OClock(5)--领取按钮的倒计时 local timeDown = CalculateSecondsNowTo_N_OClock(5)--领取按钮的倒计时
self.oneHintTxt.text =string.format(Language[12412],TimeToHMS(timeDown)) self.oneHintTxt.text =string.format(Language[12412],TimeToHMS(timeDown))
--免费次数刷新倒计时 --免费次数刷新倒计时
self.timer = Timer.New(function() self.timer = Timer.New(function()
@ -247,13 +268,6 @@ function PokemonSummonPanel:TimeToDHMS(second)
end end
end end
function PokemonSummonPanel:refreshMagicNum()
local actData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.QianKunBox)
-- local d = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySpecialConfig,"Type",singleRecruit.MergePool)
--self.leftUptips1.text = d[1].Count-math.floor(actData.value/1000)
-- self.oneHintTxt.text = tostring(d[2].Count-actData.value%1000)..Language[12264]
end
function PokemonSummonPanel:OnSortingOrderChange(_sortingOrder) function PokemonSummonPanel:OnSortingOrderChange(_sortingOrder)
orginLayer = _sortingOrder orginLayer = _sortingOrder
end end

View File

@ -52,11 +52,14 @@ function this:OnShow(_parent,...)
var=PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.Ten var=PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.Ten
local d=RecruitManager.GetExpendData(RecruitType.Ten) local d=RecruitManager.GetExpendData(RecruitType.Ten)
this.rootText.text = string.format(Language[12376],d[2]) this.rootText.text = string.format(Language[12376],d[2])
elseif _args[1] == RecruitType.LingShowSingle then
var=PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.LingShowTen
this.rootText.text = string.format("确认花费%s妖晶进行1次灵兽召唤",_args[3])
elseif _args[1] == RecruitType.LingShowTen then
var = PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.LingShowTen
this.rootText.text = string.format("确认花费%s妖晶进行10次灵兽召唤",_args[3])
else else
LogBlue("_args[1]:".._args[1])
local data = ConfigManager.GetConfigData(ConfigName.LotterySetting,_args[1]) local data = ConfigManager.GetConfigData(ConfigName.LotterySetting,_args[1])
LogBlue("data.PerCount:"..data.PerCount)
LogBlue("data.ActivityId:"..data.ActivityId)
local activityData local activityData
if data.LotteryType == 3 then if data.LotteryType == 3 then
activityData = ConfigManager.GetConfigData(ConfigName.GlobalActivity,data.ActivityId) activityData = ConfigManager.GetConfigData(ConfigName.GlobalActivity,data.ActivityId)

View File

@ -25,15 +25,23 @@ function this.Initialize()
this.InitPreData() this.InitPreData()
end end
--请求抽卡 1抽卡类型 2回调 3特权id --请求抽卡 1抽卡类型 2回调 3特权id
function this.RecruitRequest(recruitType, func, privilegeId) function this.RecruitRequest(recruitType, func, privilegeId,_itemId,_itemNum)
local data=this.GetExpendData(recruitType) local itemId = 0
local itemId,itemNum=data[1],data[2] --默认 local itemNum = 0
local freeTimesId = ConfigManager.GetConfigData(ConfigName.LotterySetting,RecruitType.LingShowSingle).FreeTimes
if privilegeId == freeTimesId then
itemId = _itemId
itemNum = _itemNum
else
local data=this.GetExpendData(recruitType)
itemId,itemNum=data[1],data[2] --默认
end
--Log("BagManager.GetItemCountById(itemId) ".. BagManager.GetItemCountById(itemId).." itemNum "..itemNum) --Log("BagManager.GetItemCountById(itemId) ".. BagManager.GetItemCountById(itemId).." itemNum "..itemNum)
--Log(tostring(this.freeUseTimeList[privilegeId])) --Log(tostring(this.freeUseTimeList[privilegeId]))
if BagManager.GetItemCountById(itemId) >= itemNum or (this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1) or isFindFairyFree then if BagManager.GetItemCountById(itemId) >= itemNum or (this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1) then
NetManager.RecruitRequest(recruitType, function(msg) NetManager.RecruitRequest(recruitType, function(msg)
local data = ConfigManager.GetConfigData(ConfigName.LotterySetting,recruitType) local data = ConfigManager.GetConfigData(ConfigName.LotterySetting,recruitType)
if (RecruitType.Single == recruitType or RecruitType.NormalSingle==recruitType or (data.LotteryType == 3 and data.PerCount == 1) or(data.LotteryType == 9 and data.PerCount == 1) ) then --若某抽卡类型有免费次数 if (RecruitType.Single == recruitType or RecruitType.NormalSingle==recruitType or (data.LotteryType == 3 and data.PerCount == 1) or(data.LotteryType == 9 and data.PerCount == 1) or RecruitType.LingShowSingle==recruitType ) then --若某抽卡类型有免费次数
if this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1 then if this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1 then
PrivilegeManager.RefreshPrivilegeUsedTimes(privilegeId, 1) PrivilegeManager.RefreshPrivilegeUsedTimes(privilegeId, 1)
this.freeUseTimeList[privilegeId] = PrivilegeManager.GetPrivilegeRemainValue(privilegeId) this.freeUseTimeList[privilegeId] = PrivilegeManager.GetPrivilegeRemainValue(privilegeId)

View File

@ -39,6 +39,7 @@ function SingleRecruitPanel:InitComponent()
self.againNum=Util.GetGameObject(self.againBtn,"Tip/Text"):GetComponent("Text") self.againNum=Util.GetGameObject(self.againBtn,"Tip/Text"):GetComponent("Text")
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.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")