添加左右切换按钮

dev_chengFeng
DESKTOP-98AVA47\Administrator 2021-07-16 14:18:25 +08:00
parent 4d11ade910
commit 0aa779f177
3 changed files with 248 additions and 29 deletions

View File

@ -192,6 +192,114 @@ MonoBehaviour:
m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!1 &554305504768656387
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2826928392027725164}
- component: {fileID: 1852298991012399287}
- component: {fileID: 4536345569108787035}
- component: {fileID: 3549991877147551305}
m_Layer: 5
m_Name: leftAction
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2826928392027725164
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 554305504768656387}
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: []
m_Father: {fileID: 8396209728857207438}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -107.1, y: 158.6}
m_SizeDelta: {x: 214.4, y: 235.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1852298991012399287
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 554305504768656387}
m_CullTransparentMesh: 0
--- !u!114 &4536345569108787035
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 554305504768656387}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 3549991877147551305}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &3549991877147551305
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 554305504768656387}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e459a084d8e15a240b58db751097122b, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
--- !u!1 &1587060591748614122
GameObject:
m_ObjectHideFlags: 0
@ -1283,6 +1391,114 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &7509327677438501955
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1684686218255945504}
- component: {fileID: 6243142082612930318}
- component: {fileID: 4889954828801934496}
- component: {fileID: 2293086032315268913}
m_Layer: 5
m_Name: rightAction
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1684686218255945504
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7509327677438501955}
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: []
m_Father: {fileID: 8396209728857207438}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 99, y: 158.60004}
m_SizeDelta: {x: 198.2, y: 235.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6243142082612930318
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7509327677438501955}
m_CullTransparentMesh: 0
--- !u!114 &4889954828801934496
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7509327677438501955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 2293086032315268913}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &2293086032315268913
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7509327677438501955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e459a084d8e15a240b58db751097122b, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
--- !u!1 &8452005726723476382
GameObject:
m_ObjectHideFlags: 0
@ -1319,6 +1535,8 @@ RectTransform:
- {fileID: 909235706}
- {fileID: 9126201947357063014}
- {fileID: 1923779622248223204}
- {fileID: 2826928392027725164}
- {fileID: 1684686218255945504}
m_Father: {fileID: 6861030463589856289}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -139,6 +139,7 @@ function this:InitComponent()
-- this.btnGuanxing = Util.GetGameObject(this.gameObject, "scene/layer4/btnGuanxing")
this.btnRecruit = Util.GetGameObject(this.gameObject, "scene/layer6/btnRecruit")
this.btnElementDrawCard = Util.GetGameObject(this.gameObject, "scene/layer4/btnElementDrawCard")
this.btnElementDrawCard.gameObject:SetActive(false)
this.btnSecretBox = Util.GetGameObject(this.gameObject, "scene/layer4/btnSecretBox")
this.btnYiYao = Util.GetGameObject(this.gameObject, "scene/layer4/btnYiYao")
this.btnPokemon = Util.GetGameObject(this.gameObject, "scene/layer6/btnPokemon")
@ -156,7 +157,7 @@ function this:InitComponent()
[FUNCTION_OPEN_TYPE.ENDLESS] = this:AddFuncItem(this.btnColorfulWorld, -1500),
[FUNCTION_OPEN_TYPE.COMPOUND] = this:AddFuncItem(this.btnEquipCompound, -200),
[FUNCTION_OPEN_TYPE.RECURITY] = this:AddFuncItem(this.btnRecruit, -56),
[FUNCTION_OPEN_TYPE.ELEMENT_RECURITY] = this:AddFuncItem(this.btnElementDrawCard, 0),
--[FUNCTION_OPEN_TYPE.ELEMENT_RECURITY] = this:AddFuncItem(this.btnElementDrawCard, 0),
[FUNCTION_OPEN_TYPE.COMPOUND_HERO] = this:AddFuncItem(this.btnCompoundHero, 0),--神将合成、置换
[FUNCTION_OPEN_TYPE.POKEMON] = this:AddFuncItem(this.btnPokemon, -1200),--神将合成、置换
[FUNCTION_OPEN_TYPE.tianshumijuan] = this:AddFuncItem(this.btnTianShuMiJuan, 0),
@ -170,7 +171,7 @@ function this:InitComponent()
[FUNCTION_OPEN_TYPE.ENDLESS] = this:InsertNewText(this.btnColorfulWorld),
[FUNCTION_OPEN_TYPE.COMPOUND] = this:InsertNewText(this.btnEquipCompound),
[FUNCTION_OPEN_TYPE.RECURITY] = this:InsertNewText(this.btnRecruit),
[FUNCTION_OPEN_TYPE.ELEMENT_RECURITY] = this:InsertNewText(this.btnElementDrawCard),
--[FUNCTION_OPEN_TYPE.ELEMENT_RECURITY] = this:InsertNewText(this.btnElementDrawCard),
[FUNCTION_OPEN_TYPE.COMPOUND_HERO] = this:InsertNewText(this.btnCompoundHero),--神将合成、置换
[FUNCTION_OPEN_TYPE.POKEMON] = this:InsertNewText(this.btnPokemon),--神将合成、置换
[FUNCTION_OPEN_TYPE.tianshumijuan] = this:InsertNewText(this.btnTianShuMiJuan),
@ -411,13 +412,13 @@ function this:BindEvent()
end)
this.ScenceBtnClick(FUNCTION_OPEN_TYPE.RECURITY)
end)
--元素招募
Util.AddClick(this.btnElementDrawCard, function()
this.FunctionClickEvent(FUNCTION_OPEN_TYPE.ELEMENT_RECURITY, function ()
UIManager.OpenPanel(UIName.RecruitMainPanel,TableRecruitType.Siyuanzhen)
end)
this.ScenceBtnClick(FUNCTION_OPEN_TYPE.ELEMENT_RECURITY)
end)
-- --元素招募
-- Util.AddClick(this.btnElementDrawCard, function()
-- this.FunctionClickEvent(FUNCTION_OPEN_TYPE.ELEMENT_RECURITY, function ()
-- UIManager.OpenPanel(UIName.RecruitMainPanel,TableRecruitType.Siyuanzhen)
-- end)
-- this.ScenceBtnClick(FUNCTION_OPEN_TYPE.ELEMENT_RECURITY)
-- end)
--秘盒
Util.AddClick(this.btnSecretBox, function()
this.FunctionClickEvent(FUNCTION_OPEN_TYPE.SECRETBOX, function ()

View File

@ -20,8 +20,8 @@ function RecruitMainPanel:InitComponent()
this.content = Util.GetGameObject(self.gameObject, "bg/pageContent")
this.item = Util.GetGameObject(this.tabbox, "tab")
this.grid = Util.GetGameObject(this.tabbox, "box")
-- this.leftBtn = Util.GetGameObject(this.tabbox, "leftAction")
-- this.rightBtn = Util.GetGameObject(this.tabbox, "rightAction")
this.leftBtn = Util.GetGameObject(this.tabbox, "leftAction")
this.rightBtn = Util.GetGameObject(this.tabbox, "rightAction")
this.jiantouyou = Util.GetGameObject(this.tabbox, "jiantouyou")
this.jiantouzuo = Util.GetGameObject(this.tabbox, "jiantouzuo")
this.mask1 = Util.GetGameObject(this.tabbox, "mask"):GetComponent("Image")
@ -149,24 +149,24 @@ function RecruitMainPanel:BindEvent()
Util.AddClick(this.btnBack, function()
this:ClosePanel()
end)
-- Util.AddClick(this.leftBtn, function()
-- this.mask:SetActive(true)
-- this.MoveTo(3)
-- Timer.New(function()
-- this.SortItemList()
-- this:LeftAction()
-- this.mask:SetActive(false)
-- end,0.3):Start()
-- end)
-- Util.AddClick(this.rightBtn, function()
-- this.mask:SetActive(true)
-- this.MoveTo(2)
-- Timer.New(function()
-- this.SortItemList()
-- this:RightAction()
-- this.mask:SetActive(false)
-- end,0.3):Start()
-- end)
Util.AddClick(this.leftBtn, function()
this.mask:SetActive(true)
this.MoveTo(3)
Timer.New(function()
this.SortItemList()
this:LeftAction()
this.mask:SetActive(false)
end,0.23):Start()
end)
Util.AddClick(this.rightBtn, function()
this.mask:SetActive(true)
this.MoveTo(2)
Timer.New(function()
this.SortItemList()
this:RightAction()
this.mask:SetActive(false)
end,0.23):Start()
end)
Util.AddClick(this.jiantouyou , function()
this.mask:SetActive(true)