【牛气冲天】提交

dev_chengFeng
ZhangBiao 2021-03-24 13:43:56 +08:00
parent 2c5159fc11
commit b63845938a
5 changed files with 128 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,88 @@
fileFormatVersion: 2
guid: 7b4a035ab46672645be2bbb89bad32b8
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: 3c624733b1dc1d14f96fb3f54ed7ca8a
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -474,7 +474,7 @@ PanelType = {
HongMengTower = {100,16,14,3},-- 鸿蒙碑
XinJiangLaiXi = {14,16,1210},--新将来袭
XiangYaoDuoBao = {14,16,1220},--降妖夺宝
NiuQiChongTian = {14,16,1006},--牛气冲天
NiuQiChongTian = {14,16,1300},--牛气冲天
}
@ -1144,6 +1144,7 @@ TaskTypeDef = {
FindTreasure = 8, -- 迷宫寻宝任务
Achievement = 9, -- 所有成就任务
DynamicActTask = 10, --主题活动任务
NiuQiChongTian = 11,--牛气冲天任务
}
--商品类型

View File

@ -24,7 +24,7 @@ function this.GetProgressData()
data.missionId = value.missionId
data.reward = v.Reward
data.value = v.Values
if curScore >= data.value then
if curScore >= data.value[2][1] then
if value.state == 0 then
data.state = 1--可领的
else
@ -64,6 +64,10 @@ end
--需要显示的任务数据
function this.GetNeedRewardData()
local temp = TaskManager.GetTypeTaskList(TaskTypeDef.NiuQiChongTian)
-- for k,v in ipairs(temp) do
-- LogGreen("missionId:"..tostring(v.missionId).." state:"..tostring(v.state))
-- end
local allData = this.GetAllRewardData()
local needData = {}
for i = 1, 3 do
@ -72,9 +76,10 @@ function this.GetNeedRewardData()
for k = 1, 2 do
if allData[i][j][k] then
local data = {}
data.Id = allData[i][j][k].Id
data.Text = allData[i][j][k].Text
data.Reward = allData[i][j][k].Reward
data.state = 1
data.state = temp[data.Id].state
table.insert(needData[i],data)
end
end

View File

@ -9,6 +9,7 @@ local progressData = {}
local rewardData = {}
local curScore = 0
local itemsGrid = {}--item重复利用
local curPage = 1
local TabBox = require("Modules/Common/TabBox")
local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "诸神" },
@ -18,6 +19,12 @@ local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1),
select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)}
local curIndex = 1
local BtnState ={
[0] = {ImgName = "s_slbz_1anniuhuangse",Text = Language[10556]},
[1] = {ImgName = "s_slbz_1anniuongse",Text = Language[11948]},
[2] = {ImgName = "s_slbz_1anniuhuise",Text = Language[10101]},
}
--初始化组件(用于子类重写)
function NiuQiChongTian:InitComponent()
self.backBtn = Util.GetGameObject(self.gameObject,"backBtn")
@ -87,21 +94,22 @@ end
--切换
function this.SwitchView(index)
curPage = index
progressData = NiuQiChongTianManager.GetProgressData()
curScore = NiuQiChongTianManager.GetScore()
rewardData = NiuQiChongTianManager.GetNeedRewardData()
-- NiuQiChongTian:SetProgress()
NiuQiChongTian:SetProgress()
NiuQiChongTian:SetReward(index)
end
function NiuQiChongTian:SetProgress()
self.progress.fillAmount = curScore/progressData[#progressData].Values[1][2]
self.progress.fillAmount = curScore/progressData[#progressData].value[2][1]
for i = 1, self.reward.transform.childCount do
local item = self.reward.transform:GetChild(i-1)
Util.GetGameObject(item, "num/Text"):GetComponent("Text").text = progressData[i].Reward[1][2]
Util.GetGameObject(item, "Text"):GetComponent("Text").text = progressData[i].Values[1][2]
Util.GetGameObject(item, "icon"):GetComponent("Image").sprite = Util.LoadSprite(artConfig[itemConfig[progressData[i].Reward[1][1]].Icon].Name)
Util.GetGameObject(item, "num/Text"):GetComponent("Text").text = progressData[i].reward[1][2]
Util.GetGameObject(item, "Text"):GetComponent("Text").text = progressData[i].value[2][1]
Util.GetGameObject(item, "icon"):GetComponent("Image").sprite = Util.LoadSprite(artConfig[itemConfig[progressData[i].reward[1][1]].ResourceID].Name)
Util.GetGameObject(item, "red"):SetActive(progressData[i].state == 1)
local btn = Util.GetGameObject(item, "icon")
Util.AddOnceClick(btn,function ()
@ -112,7 +120,7 @@ function NiuQiChongTian:SetProgress()
end)
end)
else
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,progressData[i].Reward[1][1],nil)
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,progressData[i].reward[1][1],nil)
end
end)
end
@ -128,16 +136,20 @@ end
function NiuQiChongTian:SingleDataShow(go, index,data)
local title = Util.GetGameObject(go, "title/titleText"):GetComponent("Text")
local btn = Util.GetGameObject(go, "btn")
local btn = Util.GetGameObject(go, "btn"):GetComponent("Button")
local btnImg = Util.GetGameObject(go, "btn"):GetComponent("Image")
local btnText = Util.GetGameObject(go, "btn/Text"):GetComponent("Text")
local redPoint = Util.GetGameObject(go, "btn/redPoint")
local rewardList = Util.GetGameObject(go, "rewardList")
local grid = Util.GetGameObject(go, "rewardList")
local shadow = Util.GetGameObject(go, "shadow")
title.text = data.Text
local shows = data.Reward
title.text = data.Text
redPoint:SetActive(data.state == 1)
btn.interactable = data.state ~= 2
btnImg.sprite = Util.LoadSprite(BtnState[data.state].ImgName)
btnText.text = BtnState[data.state].Text
--滚动条复用重设itemview
if itemsGrid[go] then
for i = 1, 4 do
@ -166,6 +178,17 @@ function NiuQiChongTian:SingleDataShow(go, index,data)
end
end
Util.AddOnceClick(btn.gameObject,function ()
if data.state == 0 then
UIManager.OpenPanel(UIName.RecruitPanel)
elseif data.state == 1 then
NetManager.TakeMissionRewardRequest(TaskTypeDef.NiuQiChongTian,data.Id,function (msg)
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function ()
this.SwitchView(curPage)
end)
end)
end
end)
end
--界面关闭时调用(用于子类重写)