【寻仙招募】增加心愿阵营条

dev_chengFeng
ZhangBiao 2021-11-26 09:54:12 +08:00
parent db5627ab24
commit 45df1fb982
2 changed files with 49 additions and 98 deletions

View File

@ -2974,7 +2974,7 @@ GameObject:
- component: {fileID: 827596136852617982} - component: {fileID: 827596136852617982}
- component: {fileID: 7817526988259091215} - component: {fileID: 7817526988259091215}
m_Layer: 5 m_Layer: 5
m_Name: Image m_Name: choosed
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -2987,12 +2987,12 @@ RectTransform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 146866445931924825} m_GameObject: {fileID: 146866445931924825}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
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: []
m_Father: {fileID: 2744616770045529892} m_Father: {fileID: 8741988890369470575}
m_RootOrder: 0 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}
@ -3496,7 +3496,7 @@ GameObject:
- component: {fileID: 4583208166459458474} - component: {fileID: 4583208166459458474}
- component: {fileID: 4655404213318427967} - component: {fileID: 4655404213318427967}
m_Layer: 5 m_Layer: 5
m_Name: ren m_Name: btn1
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -4607,7 +4607,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!224 &6511771316027140810 --- !u!224 &6511771316027140810
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -4625,7 +4625,7 @@ RectTransform:
- {fileID: 4217943801993723705} - {fileID: 4217943801993723705}
- {fileID: 49747897146898950} - {fileID: 49747897146898950}
m_Father: {fileID: 3828362588263756447} m_Father: {fileID: 3828362588263756447}
m_RootOrder: 5 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}
@ -10350,7 +10350,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 7624266668425807486} - {fileID: 7624266668425807486}
m_Father: {fileID: 3828362588263756447} m_Father: {fileID: 3828362588263756447}
m_RootOrder: 7 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}
@ -11010,7 +11010,7 @@ GameObject:
- component: {fileID: 6361078885167551951} - component: {fileID: 6361078885167551951}
- component: {fileID: 887536551713419381} - component: {fileID: 887536551713419381}
m_Layer: 5 m_Layer: 5
m_Name: dao m_Name: btn4
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -11595,7 +11595,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: 3828362588263756447} m_Father: {fileID: 3828362588263756447}
m_RootOrder: 6 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}
@ -13360,7 +13360,7 @@ GameObject:
- component: {fileID: 5702460646373984212} - component: {fileID: 5702460646373984212}
- component: {fileID: 1319998414647322639} - component: {fileID: 1319998414647322639}
m_Layer: 5 m_Layer: 5
m_Name: yao m_Name: btn3
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -14220,7 +14220,7 @@ GameObject:
- component: {fileID: 1942408133728493382} - component: {fileID: 1942408133728493382}
- component: {fileID: 6298930554117602117} - component: {fileID: 6298930554117602117}
m_Layer: 5 m_Layer: 5
m_Name: fo m_Name: btn2
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -18752,7 +18752,6 @@ RectTransform:
- {fileID: 6301399342645646786} - {fileID: 6301399342645646786}
- {fileID: 991052989448693348} - {fileID: 991052989448693348}
- {fileID: 8741988890369470575} - {fileID: 8741988890369470575}
- {fileID: 2744616770045529892}
- {fileID: 6511771316027140810} - {fileID: 6511771316027140810}
- {fileID: 956116599611124295} - {fileID: 956116599611124295}
- {fileID: 2528449649072630224} - {fileID: 2528449649072630224}
@ -21692,7 +21691,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 8335458866821751845} - {fileID: 8335458866821751845}
m_Father: {fileID: 3828362588263756447} m_Father: {fileID: 3828362588263756447}
m_RootOrder: 8 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}
@ -29192,81 +29191,6 @@ MonoBehaviour:
m_FillClockwise: 1 m_FillClockwise: 1
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
--- !u!1 &7911604035602096385
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2744616770045529892}
- component: {fileID: 1661966811829424584}
- component: {fileID: 1702917892883696370}
m_Layer: 5
m_Name: choosed
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2744616770045529892
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7911604035602096385}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4277764752728120099}
m_Father: {fileID: 3828362588263756447}
m_RootOrder: 4
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: -1000, y: 259.99997}
m_SizeDelta: {x: 150, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1661966811829424584
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7911604035602096385}
m_CullTransparentMesh: 0
--- !u!114 &1702917892883696370
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7911604035602096385}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: e08392d1450605647ae1f1c974176726, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &7993790152253622842 --- !u!1 &7993790152253622842
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -32708,6 +32632,7 @@ RectTransform:
- {fileID: 986730965637877389} - {fileID: 986730965637877389}
- {fileID: 4573891418480574583} - {fileID: 4573891418480574583}
- {fileID: 4182582917172664206} - {fileID: 4182582917172664206}
- {fileID: 4277764752728120099}
m_Father: {fileID: 3828362588263756447} m_Father: {fileID: 3828362588263756447}
m_RootOrder: 3 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -6,6 +6,7 @@ local parent
local sortingOrder=0 local sortingOrder=0
local args=nil local args=nil
local currHeroId=0 local currHeroId=0
local curPage = 1
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig) local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
@ -30,6 +31,15 @@ function this:InitComponent(gameObject)
this.ScrollView.moveTween.MomentumAmount = 1 this.ScrollView.moveTween.MomentumAmount = 1
this.ScrollView.moveTween.Strength = 2 this.ScrollView.moveTween.Strength = 2
this.ScrollView.elastic = false this.ScrollView.elastic = false
this.selectBar = Util.GetGameObject(gameObject,"selectBar")
this.light = Util.GetGameObject(this.selectBar,"selectBtn")
this.btnList = {}
for i = 1, 4 do
this.btnList[i] = Util.GetGameObject(this.selectBar,"btn"..i)
end
this.choosedList = {}
end end
function this:BindEvent() function this:BindEvent()
@ -43,6 +53,13 @@ function this:BindEvent()
parent:ClosePanel() parent:ClosePanel()
end) end)
end) end)
for i = 1, 4 do
Util.AddClick(this.btnList[i],function()
if curPage ~= i then
this:Refresh(i)
end
end)
end
end end
function this:AddListener() function this:AddListener()
@ -55,6 +72,12 @@ function this:OnShow(_parent,_args)
args = _args args = _args
parent=_parent parent=_parent
sortingOrder =_parent.sortingOrder sortingOrder =_parent.sortingOrder
this:Refresh(1)
end
function this:Refresh(_page)
curPage = _page
this.light.transform:SetParent(this.btnList[_page].transform)
this.light.transform.localPosition = Vector3.zero
local upConfig=ConfigManager.GetConfigDataByKey(ConfigName.WishActivityUp,"ActivityId",args[1]) local upConfig=ConfigManager.GetConfigDataByKey(ConfigName.WishActivityUp,"ActivityId",args[1])
if not upConfig then if not upConfig then
return return
@ -67,7 +90,9 @@ function this:OnShow(_parent,_args)
local heroDatas={} local heroDatas={}
currHeroId=args[2] currHeroId=args[2]
for i = 1, #heros do for i = 1, #heros do
table.insert(heroDatas,heroConfig[heros[i]]) if _page == heroConfig[heros[i]].PropertyName then
table.insert(heroDatas,heroConfig[heros[i]])
end
end end
this.ScrollView:SetData(heroDatas, function(index, go) this.ScrollView:SetData(heroDatas, function(index, go)
this.SingleHeroDataShow(go,heroDatas[index],index) this.SingleHeroDataShow(go,heroDatas[index],index)
@ -85,18 +110,17 @@ function this.SingleHeroDataShow(go,_heroData,_index)
Util.GetGameObject(_go.transform, "posIcon"):SetActive(false) Util.GetGameObject(_go.transform, "posIcon"):SetActive(false)
Util.GetGameObject(_go.transform, "proIcon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.PropertyName)) Util.GetGameObject(_go.transform, "proIcon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.PropertyName))
local starGrid = Util.GetGameObject(_go.transform, "star") local starGrid = Util.GetGameObject(_go.transform, "star")
if _heroData.Id==currHeroId then local choosed = Util.GetGameObject(_go.transform, "choosed")
this.selectObj.transform:SetParent(_go.transform) this.choosedList[go] = choosed
this.selectObj.transform.localScale=Vector3.one this.choosedList[go]:SetActive( _heroData.Id==currHeroId)
this.selectObj.transform.localPosition=Vector3.New(0,0,0)
end
SetHeroStars(this.spLoader, starGrid, heroData.Star,1,nil,-15) SetHeroStars(this.spLoader, starGrid, heroData.Star,1,nil,-15)
local cardclickBtn = Util.GetGameObject(_go.transform, "icon") local cardclickBtn = Util.GetGameObject(_go.transform, "icon")
Util.AddOnceClick(cardclickBtn, function() Util.AddOnceClick(cardclickBtn, function()
this.selectObj.transform:SetParent(_go.transform)
this.selectObj.transform.localScale=Vector3.one
this.selectObj.transform.localPosition=Vector3.New(0,0,0)
currHeroId=_heroData.Id currHeroId=_heroData.Id
for k,v in pairs(this.choosedList) do
v:SetActive(false)
end
choosed:SetActive(true)
end) end)
Util.AddLongPressClick(cardclickBtn, function() Util.AddLongPressClick(cardclickBtn, function()
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, heroData.Id, heroData.Star) UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, heroData.Id, heroData.Star)
@ -111,6 +135,8 @@ end
function this:OnDestroy() function this:OnDestroy()
this.spLoader:Destroy() this.spLoader:Destroy()
this.choosedList = {}
this.btnList = {}
end end
return this return this