dev_chengFeng
ZhangBiao 2020-07-10 17:55:11 +08:00
parent b23f6fc806
commit b89c0582c0
14 changed files with 831 additions and 1016 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,121 +0,0 @@
fileFormatVersion: 2
guid: f4a1c1459c446a540aa99516180031e5
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 97, z: 0, w: 72}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 0e98902ee274f8b41b956944d824e363
vertices: []
indices:
edges: []
weights: []
spritePackingTag: TagButtonAtlas
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,88 +0,0 @@
fileFormatVersion: 2
guid: 012fac0c8066e0244891b1240cc7bee5
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 8e38069925332694b8c27184d2ad40ae
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1710,6 +1710,8 @@ RecruitType = {
Single = 12, --钻石招募单抽(神将召唤)
TimeLimitSingle=13, --限时招募单抽
TimeLimitTen=14, --限时招募十连
QianKunBoxSingle=15, --乾坤宝囊单抽
QianKunBoxTen=16, --乾坤宝囊十连
FriendTen=23, --友情招募 多次
FriendSingle=24, --友情招募 单次
NormalTen=25, --普通招募 多次

View File

@ -317,6 +317,8 @@ UIName = {
TrialMiniGamePanel = 316,-- 试炼小游戏界面
ShowEnemyInfoPanel = 317,--森罗幻境遇敌信息界面
EquipSellSelectPopup = 318,--装备分解选择界面
QianKunBoxBuyOnePanel = 319,--乾坤宝囊购买1次
QianKunBoxBuyTenPanel = 320,--乾坤宝囊购买10次
}

View File

@ -220,20 +220,25 @@ end
function ActivityDetail:OnHide()
self.gameObject:SetActive(false)
for n,m in ipairs(rate) do
if not rate[n] then
local o=Util.GetGameObject(self.gameObject,"panel/rate/rateprefab"..n)
o.gameObject.SetActive(false)
if rate then
for n,m in ipairs(rate) do
if not rate[n] then
local o=Util.GetGameObject(self.gameObject,"panel/rate/rateprefab"..n)
o.gameObject.SetActive(false)
end
end
rate={}
end
for n,m in ipairs(soulRate) do
if not soulRate[n] then
local o=Util.GetGameObject(self.gameObject,"panel/rate/rateprefab"..n)
o.gameObject.SetActive(false)
if soulRate then
for n,m in ipairs(soulRate) do
if not soulRate[n] then
local o=Util.GetGameObject(self.gameObject,"panel/rate/rateprefab"..n)
o.gameObject.SetActive(false)
end
end
soulRate={}
end
rate={}
soulRate={}
end
function ActivityDetail:OnDestroy()

View File

@ -4,8 +4,19 @@ local ActivityDetail = require("Modules/Operating/ActivityDetail")--活动详情
local iconsData = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotteryRewardConfig,"Pool",4401)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local orginLayer = 0
local bType={
Btn1=1,
Btn10=2
}
--type与lotterySetting表中的id对应
local btns={ [bType.Btn1]={name="bottom/btnOne",isInfo=Language[10644],type=RecruitType.QianKunBoxSingle}, [bType.Btn10]={name="bottom/btnTen",isInfo=Language[12182],type=RecruitType.QianKunBoxTen}}
function QianKunBox:ctor(mainPanel, gameObject)
self.mainPanel = mainPanel.transform
self.gameObject = gameObject
@ -20,6 +31,7 @@ function QianKunBox:InitComponent(gameObject)
self.bottomBar = Util.GetGameObject(self.mainPanel,"bg/bottomBar")
--leftUp
self.leftUp = Util.GetGameObject(gameObject,"leftUp")
self.leftUptips1 = Util.GetGameObject(self.leftUp,"tips/tips1"):GetComponent("Text")
self.leftUpTime = Util.GetGameObject(self.leftUp,"tips/tips2/time"):GetComponent("Text")
self.btnHelp= Util.GetGameObject(gameObject,"btnHelp")
self.helpPosition=self.btnHelp:GetComponent("RectTransform").localPosition
@ -33,11 +45,11 @@ function QianKunBox:InitComponent(gameObject)
--bottom
self.bottom = Util.GetGameObject(gameObject,"bottom")
self.btnOne = Util.GetGameObject(self.bottom,"btnOne")
self.btnTime = Util.GetGameObject(self.bottom,"btnOne/di/time"):GetComponent("Text")
self.btnTime = Util.GetGameObject(self.bottom,"countDown/di1/time"):GetComponent("Text")
self.btnTen1 = Util.GetGameObject(self.bottom,"btnTen1")
self.btnTen2 = Util.GetGameObject(self.bottom,"btnTen2")
self.btnTimes= Util.GetGameObject(self.bottom,"btnTen2/di/times"):GetComponent("Text")
self.limit = Util.GetGameObject(self.bottom,"limit")
self.btnTimes= Util.GetGameObject(self.bottom,"countDown/di2/time"):GetComponent("Text")
self.limit = Util.GetGameObject(self.bottom,"limit"):GetComponent("Text")
--detail
self.detail = Util.GetGameObject(gameObject,"detail")
--shop
@ -66,23 +78,96 @@ function QianKunBox:BindEvent()
self.tabList:SetActive(true)
self.bottomBar:SetActive(true)
end)
Util.AddClick(self.btnOne,function()
LogPink("单抽")
end)
Util.AddClick(self.btnTen1,function()
LogYellow("钥匙十连")
end)
Util.AddClick(self.btnTen2,function()
LogPurple("妖晶十连")
end)
end
function QianKunBox:OnShow()
self.gameObject:SetActive(true)
self.btnTen2:SetActive(BagManager.GetItemCountById(16)>=2000)
self.btnTen1:SetActive(BagManager.GetItemCountById(16)<2000)
self:refreshMagicNum()
self:refreshBtnShow()--刷新按钮显示
--五个魂印头像
self:contentShow()--五个魂印头像
self:storeShow()--商店
self:timeCountDown()--时间
end
function QianKunBox:refreshBtnShow()
-- self.btnTen2:SetActive(BagManager.GetItemCountById(16)>=2000)
-- self.btnTen1:SetActive(BagManager.GetItemCountById(16)<2000)
local freeTimesId=lotterySetting[RecruitType.QianKunBoxSingle].FreeTimes
local maxtimesId=lotterySetting[RecruitType.QianKunBoxSingle].MaxTimes --lotterySetting表中的MaxTimes对应privilegeConfig表中的id
local curTimes=PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)
local freeTime= 0
self.limit.text = "今日召唤上限:"..curTimes.."/"..privilegeConfig[maxtimesId].Condition[1][2]
if freeTimesId>0 then
freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId]=freeTime
end
--按钮赋值
for n, m in ipairs(btns) do
local btn=Util.GetGameObject(self.gameObject,m.name)
local redPot=Util.GetGameObject(btn.gameObject,"redPoint")
local info=Util.GetGameObject(btn.gameObject,"layout/info"):GetComponent("Text")
local icon=Util.GetGameObject(btn.gameObject,"layout/icon"):GetComponent("Image")
local num=Util.GetGameObject(btn.gameObject,"layout/num"):GetComponent("Text")
--存在免费次数 并且 免费>=1 并且是1按钮
local isFree=freeTime and freeTime >= 1 and n==bType.Btn1
redPot.gameObject:SetActive(isFree)
icon.gameObject:SetActive(not isFree)
num.gameObject:SetActive(not isFree)
self.btnTime.gameObject:SetActive(not isFree)
local itemId=0
local itemNum=0
local d
if(isFree) then
info.text=Language[11759]
else
d=RecruitManager.GetExpendData(m.type)
itemId=d[1]
itemNum=d[2]
icon.sprite=Util.LoadSprite(artResourcesConfig[itemConfig[itemId].ResourceID].Name)
info.text=m.isInfo
num.text= tostring(itemNum)
end
Util.AddOnceClick(btn,function()
if not isFree then
if BagManager.GetItemCountById(itemId)<d[2] then
PopupTipPanel.ShowTip(itemConfig[itemId].Name..Language[10492])
return
end
end
if n==bType.Btn1 then
if PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)+1>privilegeConfig[maxtimesId].Condition[1][2] then
PopupTipPanel.ShowTip(Language[11760])
return
end
RecruitManager.RecruitRequest(m.type, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,1)--记录抽卡次数
UIManager.OpenPanel(UIName.QianKunBoxBuyOnePanel,msg.drop)
CheckRedPointStatus(RedPointType.QianKunBox)
end,freeTimesId)
elseif n==bType.Btn10 then
if PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)+10>privilegeConfig[maxtimesId].Condition[1][2] then
PopupTipPanel.ShowTip(Language[11760])
return
end
RecruitManager.RecruitRequest(m.type, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,10)--记录抽卡次数
UIManager.OpenPanel(UIName.QianKunBoxBuyTenPanel,msg.drop)
CheckRedPointStatus(RedPointType.QianKunBox)
end,freeTimesId)
end
end)
end
end
--五个魂印头像
function QianKunBox:contentShow()
for i = 1, 5 do
local icon = Util.GetGameObject(self.icons,"icon"..i.."/icon"):GetComponent("Image")
local kuang = Util.GetGameObject(self.icons,"icon"..i.."/kuang"):GetComponent("Image")
@ -96,15 +181,19 @@ function QianKunBox:OnShow()
UIManager.OpenPanel(UIName.SoulPrintPopUp,nil,nil,iconsData[i].Reward[1],nil,nil)
end)
end
end
--商店
--商店
function QianKunBox:storeShow()
if not self.shopView then
self.shopView = SubUIManager.Open(SubUIConfig.ShopView, self.content.transform)
end
self.shopView:ShowShop(SHOP_TYPE.QIANKUNBOX_SHOP,orginLayer)
self.live = poolManager:LoadLive("live2d_ui_h_52_xx_pf1", self.live.transform, Vector3.New(0.25,0.25,0.25), Vector3.New(123,214,0))
end
--时间
--时间
function QianKunBox:timeCountDown()
local timeDown=CalculateSecondsNowTo_N_OClock(5)--领取按钮的倒计时
self.btnTime.text = TimeToHMS(timeDown)
self.shopData = ShopManager.GetShopDataByType(SHOP_TYPE.QIANKUNBOX_SHOP)--获取活动信息
@ -117,6 +206,14 @@ function QianKunBox:OnShow()
self.timer:Start()
end
function QianKunBox:refreshMagicNum()
local actData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.QianKunBox)
LogYellow("ID:"..actData.activityId.." value"..actData.value)
self.leftUptips1.text = 100-math.floor(actData.value/1000).."次内必得红色魂印"
self.btnTimes.text = 30-actData.value%1000
end
function QianKunBox:OnSortingOrderChange(_sortingOrder)
orginLayer = _sortingOrder
end

View File

@ -0,0 +1,126 @@
require("Base/BasePanel")
QianKunBoxBuyOnePanel = Inherit(BasePanel)
local this=QianKunBoxBuyOnePanel
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local gameSetting=ConfigManager.GetConfig(ConfigName.GameSetting)
local lotterySetting = ConfigManager.GetConfig(ConfigName.LotterySetting)
local maxtimesId=lotterySetting[RecruitType.QianKunBoxSingle].MaxTimes
local freeTimesId=lotterySetting[RecruitType.QianKunBoxSingle].FreeTimes
--活动抽卡类型(动态的数据)
local drawtType={
FindFairySingle=0,
}
local orginLayer
--初始化组件(用于子类重写)
function QianKunBoxBuyOnePanel:InitComponent()
orginLayer = 10
self.bg = Util.GetGameObject(self.gameObject, "effect")
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft, panelType = PanelType.ElementDrawCard })
screenAdapte(self.bg)
this.btnBack=Util.GetGameObject(self.gameObject, "bottom/backButton")
this.content=Util.GetGameObject(self.gameObject, "content")
this.openOneAgainButton=Util.GetGameObject(self.gameObject, "bottom/openOneAgainButton")
this.detailImage=Util.GetGameObject(self.gameObject, "Tip")
this.detailText = Util.GetGameObject(this.detailImage, "Text"):GetComponent("Text")
this.content1=Util.GetGameObject(self.gameObject,"bottom/openOneAgainButton/Content1")
this.itemIcon1=Util.GetGameObject(this.content1, "Icon"):GetComponent("Image")
this.detailImage1=Util.GetGameObject(this.content1, "Tip")
this.detailText1 = Util.GetGameObject(this.detailImage1, "contentDetailText"):GetComponent("Text")
this.content2=Util.GetGameObject(self.gameObject,"bottom/openOneAgainButton/Content2")
this.itemIcon2=Util.GetGameObject(this.content2, "Icon"):GetComponent("Image")
this.itemNum2=Util.GetGameObject(this.content2,"Num"):GetComponent("Text")
-- 关于抽卡的LotterySetting数据
local curActivityId=ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
drawtType.FindFairySingle=ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"PerCount",1,"ActivityId",curActivityId).Id
end
--绑定事件(用于子类重写)
function QianKunBoxBuyOnePanel:BindEvent()
Util.AddClick(this.btnBack, function ()
self:ClosePanel()
end)
Util.AddClick(this.openOneAgainButton, function ()
if(BagManager.GetItemCountById(16)>=200) then--货币还没有,有了修改
self:ClosePanel()
RecruitManager.RecruitRequest(RecruitType.QianKunBoxSingle, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,1)--记录抽卡次数
UIManager.OpenPanel(UIName.QianKunBoxBuyOnePanel,msg.drop)
CheckRedPointStatus(RedPointType.QianKunBox)
end,freeTimesId)
else
--UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.DemonCrystal })--应跳到充值界面,现在是用之前的货币换取妖晶
PopupTipPanel.ShowTip(Language[11139])
self:ClosePanel()
end
end)
end
--添加事件监听(用于子类重写)
function QianKunBoxBuyOnePanel:AddListener()
end
--移除事件监听(用于子类重写)
function QianKunBoxBuyOnePanel:RemoveListener()
end
function QianKunBoxBuyOnePanel:OnSortingOrderChange()
Util.AddParticleSortLayer(self.bg, self.sortingOrder - orginLayer)
orginLayer = self.sortingOrder
if this.view then
this.view:OnOpen(true,this.itemDataList[1],1.4,true,false,false,self.sortingOrder)
end
end
--界面打开时调用(用于子类重写)
function QianKunBoxBuyOnePanel:OnOpen(...)
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.QianKunBox })
local args = { ... }
this.drop=args[1]
this.detailImage:SetActive(not this.recruitType)
this.content1:SetActive(not this.recruitType)
this.content2:SetActive(this.recruitType)
this.itemIcon1.sprite=Util.LoadSprite("r_RareItem_Specail_0020")
this.detailText.text = "赠送1个乾坤令"
this.detailText1.text = "赠送1个乾坤令"
Util.ClearChild(Util.GetTransform(this.content, "itemContent1"))
this.itemDataList={}
this.itemDataList=BagManager.GetTableByBackDropData(this.drop)
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, 0.5)
time:Start()
end
--界面关闭时调用(用于子类重写)
function QianKunBoxBuyOnePanel:OnClose()
end
--界面销毁时调用(用于子类重写)
function QianKunBoxBuyOnePanel:OnDestroy()
SubUIManager.Close(this.UpView)
end
return QianKunBoxBuyOnePanel

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9cc7bf6212e991d4d86daba14f0052c6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,165 @@
require("Base/BasePanel")
require("Base/Stack")
QianKunBoxBuyTenPanel = Inherit(BasePanel)
local this=QianKunBoxBuyTenPanel
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local gameSetting=ConfigManager.GetConfig(ConfigName.GameSetting)
local lotterySetting = ConfigManager.GetConfig(ConfigName.LotterySetting)
local maxtimesId=lotterySetting[RecruitType.QianKunBoxTen].MaxTimes
local freeTimesId=lotterySetting[RecruitType.QianKunBoxTen].FreeTimes
--活动抽卡类型(动态的数据)
local drawtType={
FindFairySingle=0,
FindFairyTen=0,
}
local lotterySetting = ConfigManager.GetConfig(ConfigName.LotterySetting)
local callList = Stack.New()
this.contentList={}
this.contentListParent={}
this.isElementDrawPanel=false
local orginLayer
--初始化组件(用于子类重写)
function QianKunBoxBuyTenPanel:InitComponent()
orginLayer = 0
self.bg = Util.GetGameObject(self.gameObject, "effect")
screenAdapte(self.bg)
this.btnBack=Util.GetGameObject(self.gameObject, "bottom/backButton")
this.openTenAgainButton=Util.GetGameObject(self.gameObject, "bottom/openTenAgainButton")
this.costImage=Util.GetGameObject(self.gameObject, "bottom/openTenAgainButton/Image")
this.detailImage=Util.GetGameObject(self.gameObject, "Tip")
this.detailText = Util.GetGameObject(this.detailImage, "Text"):GetComponent("Text")
this.content1=Util.GetGameObject(self.gameObject,"bottom/openTenAgainButton/Content1")
this.itemIcon1=Util.GetGameObject(this.content1,"Icon"):GetComponent("Image")
this.detailImage1=Util.GetGameObject(this.content1,"Tip")
this.detailText1 = Util.GetGameObject(this.detailImage1, "contentDetailText"):GetComponent("Text")
this.content2=Util.GetGameObject(self.gameObject,"bottom/openTenAgainButton/Content2")
this.itemIcon2=Util.GetGameObject(this.content2,"Icon"):GetComponent("Image")
this.itemNum2=Util.GetGameObject(this.content2,"Num"):GetComponent("Text")
for i = 1, 10 do
this.contentList[i]=Util.GetGameObject(self.gameObject, "content/itemAnimEffect"..i.."/image/Kuang/itemName/itemContent")
this.contentListParent[i]=Util.GetGameObject(self.gameObject, "content/itemAnimEffect"..i)
end
-- 关于抽卡的LotterySetting数据
local curActivityId=ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
drawtType.FindFairySingle=ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"PerCount",1,"ActivityId",curActivityId).Id
drawtType.FindFairyTen=ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"PerCount",10,"ActivityId",curActivityId).Id
end
--绑定事件(用于子类重写)
function QianKunBoxBuyTenPanel:BindEvent()
Util.AddClick(this.btnBack, function ()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
Util.AddClick(this.openTenAgainButton, function ()
if(BagManager.GetItemCountById(16)>=2000) then--货币还没有,有了修改
self:ClosePanel()
RecruitManager.RecruitRequest(RecruitType.QianKunBoxTen, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,10)--记录抽卡次数
UIManager.OpenPanel(UIName.QianKunBoxBuyTenPanel,msg.drop)
CheckRedPointStatus(RedPointType.QianKunBox)
end,freeTimesId)
else
--UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.DemonCrystal })--应跳到充值界面,现在是用之前的货币换取妖晶
PopupTipPanel.ShowTip(Language[11139])
self:ClosePanel()
end
end)
end
--添加事件监听(用于子类重写)
function QianKunBoxBuyTenPanel:AddListener()
end
--移除事件监听(用于子类重写)
function QianKunBoxBuyTenPanel:RemoveListener()
end
function QianKunBoxBuyTenPanel:OnSortingOrderChange()
Util.AddParticleSortLayer(self.bg, self.sortingOrder - orginLayer)
for i = 1, 10 do
Util.AddParticleSortLayer(this.contentListParent[i], self.sortingOrder - orginLayer)
end
orginLayer = self.sortingOrder
if this.views and this.itemDataList then
for index, view in pairs(this.views) do
view:OnOpen(true,this.itemDataList[index],1.4,true,false,false,self.sortingOrder)
end
end
end
--界面打开时调用(用于子类重写)
function QianKunBoxBuyTenPanel:OnOpen(...)
-- this.itemIcon1.sprite=Util.LoadSprite(GetResourcePath(ItemConfig[SecretBoxManager.MainCost[2][1][1]].ResourceID))
local args = { ... }
this.drop=args[1]
this.detailImage:SetActive(not this.recruitType)
this.content1:SetActive(not this.recruitType)
this.content2:SetActive(this.recruitType)
this.itemIcon1.sprite=Util.LoadSprite("r_RareItem_Specail_0020")
this.detailText.text = "赠送10个乾坤令"
this.detailText1.text = "赠送10个乾坤令"
local itemDataList={}
itemDataList=BagManager.GetTableByBackDropData(this.drop)
this.openTenAgainButton:GetComponent("Button").enabled=false
this.btnBack:GetComponent("Button").enabled=false
callList:Clear()
callList:Push(function ()
this.openTenAgainButton:GetComponent("Button").enabled=true
this.btnBack:GetComponent("Button").enabled=true
end)
this.views = {}
this.itemDataList = itemDataList
local dataNum = #itemDataList > 10 and 10 or #itemDataList
for i = dataNum, 1, -1 do
Util.ClearChild(this.contentList[i].transform)
this.views[i] = SubUIManager.Open(SubUIConfig.ItemView,this.contentList[i].transform)
local curItemData=itemDataList[i]
local contentGO = this.contentListParent[i]
this.views[i]:OnOpen(true,curItemData,1.4,true,false,false,self.sortingOrder)
contentGO:SetActive(false)
callList:Push(function ()
if curItemData.configData and curItemData.configData.ItemType==4 and curItemData.configData.Quantity>=gameSetting[1].IfVersion then
UIManager.OpenPanel(UIName.SecretBoxShowPokemonPanel,curItemData.configData.Id, function ()
Timer.New(function ()
contentGO:SetActive(true)
callList:Pop()()
end, 0.2):Start()
end)
else
Timer.New(function ()
contentGO:SetActive(true)
callList:Pop()()
end, 0.2):Start()
end
end)
end
callList:Pop()()
end
--界面关闭时调用(用于子类重写)
function QianKunBoxBuyTenPanel:OnClose()
end
--界面销毁时调用(用于子类重写)
function QianKunBoxBuyTenPanel:OnDestroy()
this.views = nil
end
return QianKunBoxBuyTenPanel

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5e0716c60aeac3f488cff462ab2dda06
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.