【新将来袭】差战斗了

dev_chengFeng
ZhangBiao 2020-12-02 09:51:17 +08:00
parent d860871ba6
commit 2f07beaa08
6 changed files with 1100 additions and 943 deletions

View File

@ -1956,7 +1956,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -458.15002, y: -0.000030517578}
m_AnchoredPosition: {x: -237.05199, y: -0.000030517578}
m_SizeDelta: {x: 0, y: 178.2}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &1008845928870155705
@ -1972,12 +1972,12 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 91
m_Left: 0
m_Right: 0
m_Top: -24
m_Bottom: 0
m_ChildAlignment: 3
m_Spacing: 58.14
m_Spacing: 20
m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
@ -2773,6 +2773,7 @@ GameObject:
m_Component:
- component: {fileID: 8629630502145788354}
- component: {fileID: 3544800768705243807}
- component: {fileID: 6825846372884358725}
m_Layer: 5
m_Name: scroller
m_TagString: Untagged
@ -2798,7 +2799,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -421}
m_SizeDelta: {x: 916.3, y: 178.2}
m_SizeDelta: {x: 700, y: 178.2}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3544800768705243807
MonoBehaviour:
@ -2832,6 +2833,18 @@ MonoBehaviour:
m_Calls: []
m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &6825846372884358725
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8486496540037006533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -146154839, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &8506230134569349973
GameObject:
m_ObjectHideFlags: 0

View File

@ -569,6 +569,7 @@ SHOP_TYPE = {
BUYCOIN_SHOP=57, --点金商店
QIANKUNBOX_SHOP=58, --宝囊限时商店
CELEBRATION_SHOP = 62, --社稷大典商店
XINJIANG_SHOP = 64, --新将商店
}
PropertyTypeIconDef = {

View File

@ -254,9 +254,9 @@ function this.XinJiangBuildData()
data.endTime = ActData.endTime
data.fightTime = PrivilegeManager.GetPrivilegeRemainValue(2012)
data.buyTime = PrivilegeManager.GetPrivilegeRemainValue(2013)
data.money = BagManager.GetTotalItemNum(16)
data.money = BagManager.GetTotalItemNum(1209)
local rewardGroupId = newHeroData.DropList[#newHeroData.DropList][2]
data.reward = ConfigManager.GetConfigData(ConfigName.RewardGroup,rewardGroupId).RewardItem
data.reward = ConfigManager.GetConfigData(ConfigName.RewardGroup,rewardGroupId).ShowItem
data.activityId = ActData.activityId
return data

View File

@ -93,7 +93,7 @@ local tabs = {
},
[22] = { --新将来袭
default = "x_xiangjianglaixi_icon2", lock = "x_xiangjianglaixi_icon2", select = "x_xiangjianglaixi_icon1",
rpType = RedPointType.XinJiangLaiXi,panelType = PanelType.Main,ActType = ActivityTypeDef.DynamicAct
rpType = RedPointType.XinJiangLaiXi,panelType = PanelType.Main,ActType = ActivityTypeDef.XinJiangLaiXi
},
[23] = { --限时召唤
default = "x_xianshizaohuan_02", lock = "x_xianshizaohuan_02", select = "x_xianshizaohuan_01",

View File

@ -1,7 +1,7 @@
local XinJiangLaiXi = quick_class("XinJiangLaiXi")
local this=XinJiangLaiXi
local allData={}
local itemsGrid = {}--item重复利用
local this=XinJiangLaiXi
local sortingOrder = 0
local parent = {}
-- local properTypeConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
@ -10,23 +10,23 @@ local parent = {}
-- local fakeId = 0
this.LiveObj = nil
function XinJiangLaiXi:ctor(mainPanel, gameObject)
self.mainPanel = mainPanel
self.gameObject = gameObject
self:InitComponent(gameObject)
self:BindEvent()
this.mainPanel = mainPanel.transform
this.gameObject = gameObject
this:InitComponent()
this:BindEvent()
end
function XinJiangLaiXi:InitComponent(gameObject)
this.time = Util.GetGameObject(gameObject, "time/times"):GetComponent("Text")
this.money = Util.GetGameObject(gameObject, "money/times"):GetComponent("Text")
this.fightBtn = Util.GetGameObject(gameObject, "layout/fightBtn")
this.storeBtn = Util.GetGameObject(gameObject, "layout/storeBtn")
this.helpBtn = Util.GetGameObject(gameObject, "helpBtn")
this.scrollItem = Util.GetGameObject(gameObject, "scroller/grid")
this.liveRoot = Util.GetGameObject(gameObject, "bg/liveRoot")
this.tip1 = Util.GetGameObject(gameObject, "layout/Text1"):GetComponent("Text")
this.tip2 = Util.GetGameObject(gameObject, "layout/Text2"):GetComponent("Text")
this.addBtn = Util.GetGameObject(gameObject, "layout/addBtn")
function XinJiangLaiXi:InitComponent()
this.time = Util.GetGameObject(this.gameObject, "time/times"):GetComponent("Text")
this.money = Util.GetGameObject(this.gameObject, "money/times"):GetComponent("Text")
this.fightBtn = Util.GetGameObject(this.gameObject, "layout/fightBtn")
this.storeBtn = Util.GetGameObject(this.gameObject, "storeBtn")
this.helpBtn = Util.GetGameObject(this.gameObject, "helpBtn")
this.scrollItem = Util.GetGameObject(this.gameObject, "scroller/grid")
this.liveRoot = Util.GetGameObject(this.gameObject, "bg/liveRoot")
this.tip1 = Util.GetGameObject(this.gameObject, "layout/Text1"):GetComponent("Text")
this.tip2 = Util.GetGameObject(this.gameObject, "layout/Text2"):GetComponent("Text")
this.addBtn = Util.GetGameObject(this.gameObject, "layout/addBtn")
--shop
this.tabList = Util.GetGameObject(this.mainPanel,"bg/tabbox")
@ -95,22 +95,24 @@ function XinJiangLaiXi:OnShowData()
for k,v in ipairs(itemsGrid) do
v.gameObject:SetActive(false)
end
for k,v in ipairs(allData.reward) do
if not itemsGrid[k] then
itemsGrid[k] = SubUIManager.Open(SubUIConfig.ItemView,this.scrollItem.transform)
for i = 1,#allData.reward do
if not itemsGrid[i] then
itemsGrid[i] = SubUIManager.Open(SubUIConfig.ItemView,this.scrollItem.transform)
end
itemsGrid[k].gameObject:SetActive(true)
itemsGrid[k]:OnOpen(false, v, 1,false,false,false,sortingOrder)
itemsGrid[i].gameObject:SetActive(true)
itemsGrid[i]:OnOpen(false, allData.reward[i], 1,false,false,false,sortingOrder)
end
if this.LiveObj then
poolManager:UnLoadLive(this.LiveObj.name,this.LiveObj)
this.LiveObj = nil
end
this.LiveObj = poolManager:LoadLive("l_lingshou_fenghuang",this.liveRoot.transform, Vector3.one, Vector3.zero)
this.LiveObj = poolManager:LoadLive("live2d_c_dj_0008",this.liveRoot.transform, Vector3.one, Vector3.zero)
this.tip1.text = "剩余挑战次数:".."<color=green>"..allData.fightTime.."</color>"
this.tip1.text = "剩余购买次数:".."<color=green>"..allData.buyTime.."</color>"
this.tip1.text = "剩余挑战次数:".."<color=#6BC74D>"..allData.fightTime.."</color>"
this.tip2.text = "剩余购买次数:".."<color=#6BC74D>"..allData.buyTime.."</color>"
this.money.text = allData.money
end
function XinJiangLaiXi:SetTime()
@ -119,7 +121,7 @@ function XinJiangLaiXi:SetTime()
self.timer = nil
end
local timeDown = allData.endTime - GetTimeStamp()
this.time.text = Language[12321]..TimeToDHMS(timeDown)
this.time.text = Language[12321]..TimeToFelaxible(timeDown)
self.timer = Timer.New(function()
timeDown = timeDown - 1
if timeDown < 1 then
@ -128,7 +130,7 @@ function XinJiangLaiXi:SetTime()
parent:ClosePanel()
return
end
this.time.text = Language[12321]..TimeToDHMS(timeDown)
this.time.text = Language[12321]..TimeToFelaxible(timeDown)
end, 1, -1, true)
self.timer:Start()
end
@ -139,11 +141,11 @@ function XinJiangLaiXi:OnOpen()
end
--商店
function this:StoreShow()
function XinJiangLaiXi:StoreShow()
if not this.shopView then
this.shopView = SubUIManager.Open(SubUIConfig.ShopView, this.content.transform)
end
this.shopView:ShowShop(SHOP_TYPE.CELEBRATION_SHOP,sortingOrder)
this.shopView:ShowShop(SHOP_TYPE.XINJIANG_SHOP,sortingOrder)
end
function XinJiangLaiXi:OnClose()