抽卡红点提交
parent
1ead3c126d
commit
f710e20c60
|
@ -34,7 +34,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: -0.050048828, y: 98.100006}
|
||||
m_AnchoredPosition: {x: -0.050048828, y: 98.10004}
|
||||
m_SizeDelta: {x: 320, y: 175}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &909235708
|
||||
|
@ -74,6 +74,123 @@ MonoBehaviour:
|
|||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &375968716810943835
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1923779622248223204}
|
||||
- component: {fileID: 914335610243721213}
|
||||
- component: {fileID: 3393540072771996272}
|
||||
- component: {fileID: 6219587490531008961}
|
||||
m_Layer: 5
|
||||
m_Name: jiantouzuo
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1923779622248223204
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 375968716810943835}
|
||||
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: 70.99982, y: 256.90002}
|
||||
m_SizeDelta: {x: 142, y: 129}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &914335610243721213
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 375968716810943835}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &3393540072771996272
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 375968716810943835}
|
||||
m_Enabled: 1
|
||||
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: 0.81741333}
|
||||
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
|
||||
m_Sprite: {fileID: 21300000, guid: f9398964d6d4cdf4db9b39ec0fc5f348, 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!114 &6219587490531008961
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 375968716810943835}
|
||||
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: 3393540072771996272}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!1 &1587060591748614122
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -470,7 +587,7 @@ GameObject:
|
|||
m_Component:
|
||||
- component: {fileID: 6861030463589856289}
|
||||
- component: {fileID: 6863167914432660579}
|
||||
- component: {fileID: 4117642168935113654}
|
||||
- component: {fileID: 1172124013802195281}
|
||||
m_Layer: 5
|
||||
m_Name: bg
|
||||
m_TagString: Untagged
|
||||
|
@ -508,35 +625,48 @@ CanvasRenderer:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6641942970975030909}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &4117642168935113654
|
||||
--- !u!114 &1172124013802195281
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6641942970975030909}
|
||||
m_Enabled: 0
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, 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
|
||||
m_Sprite: {fileID: 21300000, guid: 763e056f5ef269840bd80e4848cbc7b9, 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
|
||||
tweenSequeue:
|
||||
- initV3: {x: 0, y: 0, z: 0}
|
||||
initFloat: 0
|
||||
isInit: 1
|
||||
changeV3: {x: 0, y: 0, z: 0}
|
||||
changeFloat: 1
|
||||
duration: 0.5
|
||||
delay: 0
|
||||
curveType: 1
|
||||
changeType: 6
|
||||
sequeueType: 1
|
||||
loop: 999999999
|
||||
loopType: 1
|
||||
targetObj: {fileID: 9126201947357063014}
|
||||
- initV3: {x: 0, y: 0, z: 0}
|
||||
initFloat: 0
|
||||
isInit: 1
|
||||
changeV3: {x: 0, y: 0, z: 0}
|
||||
changeFloat: 1
|
||||
duration: 0.5
|
||||
delay: 0
|
||||
curveType: 1
|
||||
changeType: 6
|
||||
sequeueType: 1
|
||||
loop: 999999999
|
||||
loopType: 1
|
||||
targetObj: {fileID: 1923779622248223204}
|
||||
isPlayAudio: 0
|
||||
isHaveCloseBtn: 0
|
||||
isPlayOnOpen: 1
|
||||
--- !u!1 &6642722196727729715
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -759,6 +889,123 @@ MonoBehaviour:
|
|||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &6999682888855931865
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9126201947357063014}
|
||||
- component: {fileID: 7540209308422541695}
|
||||
- component: {fileID: 5407747526737493234}
|
||||
- component: {fileID: 4429366809599734276}
|
||||
m_Layer: 5
|
||||
m_Name: jiantouyou
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &9126201947357063014
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6999682888855931865}
|
||||
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: -70.92511, y: 256.89996}
|
||||
m_SizeDelta: {x: 142, y: 129}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7540209308422541695
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6999682888855931865}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &5407747526737493234
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6999682888855931865}
|
||||
m_Enabled: 1
|
||||
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: 0.81741333}
|
||||
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
|
||||
m_Sprite: {fileID: 21300000, guid: f9398964d6d4cdf4db9b39ec0fc5f348, 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!114 &4429366809599734276
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6999682888855931865}
|
||||
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: 5407747526737493234}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!1 &7033478305396375495
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1231,6 +1478,8 @@ RectTransform:
|
|||
- {fileID: 1553465921306343843}
|
||||
- {fileID: 5463341982538585298}
|
||||
- {fileID: 909235706}
|
||||
- {fileID: 9126201947357063014}
|
||||
- {fileID: 1923779622248223204}
|
||||
m_Father: {fileID: 6861030463589856289}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
|
@ -2644,3 +2644,13 @@ NumToChinese = {
|
|||
[19] = "十九",
|
||||
[20] = "二十",
|
||||
}
|
||||
|
||||
--抽卡配置
|
||||
PreConfigure={
|
||||
[1] = {type=RecruitType.NormalSingle,privilegeId=38},
|
||||
[2] = {type=RecruitType.NormalTen},
|
||||
[3] = {type=RecruitType.FriendSingle,privilegeId=0},
|
||||
[4] = {type=RecruitType.FriendTen},
|
||||
[5] = {type=RecruitType.Single,privilegeId=14},
|
||||
[6] = {type=RecruitType.Ten}
|
||||
}
|
|
@ -22,6 +22,8 @@ function RecruitMainPanel:InitComponent()
|
|||
this.grid = Util.GetGameObject(this.tabbox, "box")
|
||||
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.select = Util.GetGameObject(this.tabbox, "select")
|
||||
this.select.gameObject:SetActive(false)
|
||||
this.upView = SubUIManager.Open(SubUIConfig.UpView,self.gameObject.transform)
|
||||
|
@ -30,41 +32,31 @@ function RecruitMainPanel:InitComponent()
|
|||
this.moveWidth = this.grid:GetComponent("RectTransform").rect.width
|
||||
this.itemWidth = this.item:GetComponent("RectTransform").rect.width
|
||||
this.count = 3
|
||||
local off = (this.moveWidth - this.count * this.itemWidth)/(this.count - 1)
|
||||
for i = 1,this.count do
|
||||
if not this.itemList[i] then
|
||||
this.itemList[i] = {}
|
||||
this.itemList[i].go = newObjToParent(this.item,this.grid)
|
||||
this.itemList[i].go.name = "tab_"..i
|
||||
this.itemList[i].tran = this.itemList[i].go:GetComponent("RectTransform")
|
||||
local vec = this.itemList[i].tran.anchoredPosition
|
||||
vec.x = off * (i - 1) + i * this.itemWidth
|
||||
vec.y = 0
|
||||
this.itemList[i].tran.anchoredPosition = vec
|
||||
this.itemList[i].pos = this.itemList[i].tran.anchoredPosition
|
||||
this.itemList[i].index = i
|
||||
this.itemList[i].img = Util.GetGameObject(this.itemList[i].go, "img"):GetComponent("Image")
|
||||
this.itemList[i].redpot = Util.GetGameObject(this.itemList[i].go, "redpot")
|
||||
end
|
||||
end
|
||||
this.pos0 = Vector3.New(off * (0 - 1) + 0 * this.itemWidth,0,0)
|
||||
this.pos4 = Vector3.New(off * (4 - 1) + 4 * this.itemWidth,0,0)
|
||||
this.off = (this.moveWidth - this.count * this.itemWidth)/(this.count - 1)
|
||||
-- for i = 1,this.count do
|
||||
-- if not this.itemList[i] then
|
||||
-- this.itemList[i] = {}
|
||||
-- this.itemList[i].go = newObjToParent(this.item,this.grid)
|
||||
-- this.itemList[i].go.name = "tab_"..i
|
||||
-- this.itemList[i].tran = this.itemList[i].go:GetComponent("RectTransform")
|
||||
-- local vec = this.itemList[i].tran.anchoredPosition
|
||||
-- vec.x = this.off * (i - 1) + i * this.itemWidth
|
||||
-- vec.y = 0
|
||||
-- this.itemList[i].tran.anchoredPosition = vec
|
||||
-- this.itemList[i].pos = this.itemList[i].tran.anchoredPosition
|
||||
-- this.itemList[i].index = i
|
||||
-- this.itemList[i].img = Util.GetGameObject(this.itemList[i].go, "img"):GetComponent("Image")
|
||||
-- this.itemList[i].redpot = Util.GetGameObject(this.itemList[i].go, "redpot")
|
||||
-- end
|
||||
-- end
|
||||
this.pos0 = Vector3.New(this.off * (0 - 1) + 0 * this.itemWidth,0,0)
|
||||
--this.pos4 = Vector3.New(this.off * (4 - 1) + 4 * this.itemWidth,0,0)
|
||||
self.lastPage,self.curPage,self.nextPage = 0,0,0
|
||||
|
||||
this.trigger = Util.GetEventTriggerListener(self.gameObject) --触摸事件
|
||||
this.trigger.onBeginDrag = this.trigger.onBeginDrag + this.OnBeginDrag
|
||||
this.trigger.onDrag = this.trigger.onDrag + this.OnDrag
|
||||
this.trigger.onEndDrag = this.trigger.onEndDrag + this.OnEndDrag
|
||||
|
||||
-- this.moveTween = this.grid:GetComponent(typeof(UITweenSpring))
|
||||
-- if not this.moveTween then
|
||||
-- this.moveTween = this.grid:AddComponent(typeof(UITweenSpring))
|
||||
-- end
|
||||
-- this.moveTween.enabled = false
|
||||
-- this.moveTween.OnUpdate = this.SetPos
|
||||
-- this.moveTween.OnMoveEnd = this.MoveTo
|
||||
-- this.moveTween.MomentumAmount = 0.5
|
||||
-- this.moveTween.Strength = 1
|
||||
end
|
||||
|
||||
function this.SortItemList()
|
||||
|
@ -171,6 +163,71 @@ function RecruitMainPanel:BindEvent()
|
|||
this.mask:SetActive(false)
|
||||
end,0.3):Start()
|
||||
end)
|
||||
|
||||
Util.AddClick(this.jiantouyou , function()
|
||||
this.mask:SetActive(true)
|
||||
for i = self.curPage - 1,1,-1 do
|
||||
if self.dicData[i].RpType and self.dicData[i].RpType > 0 then
|
||||
if RecruitManager.GetAllRecruitBtnRedpoint(self.dicData[i].RpType) then
|
||||
self.curPage = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
self.lastPage = self.curPage - 1 > 0 and self.curPage - 1 or #self.dicData
|
||||
self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1
|
||||
lastIndex = self.curPage
|
||||
this:SetIndex()
|
||||
this:PageOnChange()
|
||||
end)
|
||||
Util.AddClick(this.jiantouzuo , function()
|
||||
this.mask:SetActive(true)
|
||||
for i = self.curPage + 1,#self.dicData,1 do
|
||||
if self.dicData[i].RpType and self.dicData[i].RpType > 0 then
|
||||
if RecruitManager.GetAllRecruitBtnRedpoint(self.dicData[i].RpType) then
|
||||
self.curPage = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
self.curPage = 0
|
||||
self.lastPage = self.curPage - 1 > 0 and self.curPage - 1 or #self.dicData
|
||||
self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1
|
||||
lastIndex = self.curPage
|
||||
this:SetIndex()
|
||||
this:PageOnChange()
|
||||
end)
|
||||
end
|
||||
|
||||
function RecruitMainPanel:RefreshJianTou()
|
||||
local index = 0
|
||||
for i = self.curPage - 1,1,-1 do
|
||||
if self.dicData[i].RpType and self.dicData[i].RpType > 0 then
|
||||
if RecruitManager.GetAllRecruitBtnRedpoint(self.dicData[i].RpType) then
|
||||
index = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if index == 0 then
|
||||
this.jiantouyou.gameObject:SetActive(false)
|
||||
else
|
||||
this.jiantouyou.gameObject:SetActive(true)
|
||||
end
|
||||
index = 0
|
||||
for i = self.curPage + 1,#self.dicData,1 do
|
||||
if self.dicData[i].RpType and self.dicData[i].RpType > 0 then
|
||||
if RecruitManager.GetAllRecruitBtnRedpoint(self.dicData[i].RpType) then
|
||||
index = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if index == 0 then
|
||||
this.jiantouzuo.gameObject:SetActive(false)
|
||||
else
|
||||
this.jiantouzuo.gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
|
@ -197,6 +254,7 @@ end
|
|||
function RecruitMainPanel:OnShow()
|
||||
orginLayer = self.sortingOrder
|
||||
self.dicData = RecruitManager.GetRecruitData()
|
||||
this:RefreshTabData()
|
||||
for i = 1,#self.dicData do
|
||||
if self.dicData[i].ShopData[1][1] == self.CurRecruitId then
|
||||
self.curPage = i
|
||||
|
@ -206,30 +264,94 @@ function RecruitMainPanel:OnShow()
|
|||
self.lastPage = self.curPage - 1 > 0 and self.curPage - 1 or #self.dicData
|
||||
self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1
|
||||
lastIndex = self.curPage
|
||||
this:RefreshTabData()
|
||||
this:SetIndex(self.curPage)
|
||||
this:PageOnChange()
|
||||
end
|
||||
|
||||
function this:RefreshTabData()
|
||||
local curIndex = 0
|
||||
--local curIndex = 0
|
||||
--清除红点
|
||||
for k,v in pairs(redPointTypeList) do
|
||||
ClearRedPointObject(k,v)
|
||||
end
|
||||
redPointTypeList = {}
|
||||
for i = 1,#this.itemList do
|
||||
if i == 1 then
|
||||
curIndex = self.lastPage
|
||||
elseif i == 2 then
|
||||
curIndex = self.curPage
|
||||
|
||||
-- for i = 1,#this.itemList do
|
||||
-- if i == 1 then
|
||||
-- curIndex = self.lastPage
|
||||
-- elseif i == 2 then
|
||||
-- curIndex = self.curPage
|
||||
-- else
|
||||
-- curIndex = self.nextPage
|
||||
-- end
|
||||
-- this.itemList[i].img.sprite = this.spLoader:LoadSprite(self.dicData[curIndex].Icon[1])
|
||||
-- BindRedPointObject(self.dicData[curIndex].RpType,this.itemList[i].redpot)
|
||||
-- redPointTypeList[self.dicData[curIndex].RpType] = this.itemList[i].redpot
|
||||
-- end
|
||||
for i = 1,math.max(#this.itemList,#self.dicData) do
|
||||
if not self.dicData[i] then
|
||||
this.itemList[i].go.gameObject:SetActive(false)
|
||||
else
|
||||
curIndex = self.nextPage
|
||||
if not this.itemList[i] then
|
||||
this.itemList[i] = {}
|
||||
this.itemList[i].go = newObjToParent(this.item,this.grid)
|
||||
this.itemList[i].go.name = "tab_"..i
|
||||
this.itemList[i].tran = this.itemList[i].go:GetComponent("RectTransform")
|
||||
local vec = this.itemList[i].tran.anchoredPosition
|
||||
vec.x = this.off * (i - 1) + i * this.itemWidth
|
||||
vec.y = 0
|
||||
this.itemList[i].tran.anchoredPosition = vec
|
||||
this.itemList[i].pos = this.itemList[i].tran.anchoredPosition
|
||||
this.itemList[i].index = i
|
||||
this.itemList[i].img = Util.GetGameObject(this.itemList[i].go, "img"):GetComponent("Image")
|
||||
this.itemList[i].redpot = Util.GetGameObject(this.itemList[i].go, "redpot")
|
||||
this.itemList[i].pageIndex = i
|
||||
end
|
||||
this.itemList[i].go.gameObject:SetActive(true)
|
||||
this.itemList[i].img.sprite = this.spLoader:LoadSprite(self.dicData[i].Icon[1])
|
||||
BindRedPointObject(self.dicData[i].RpType,this.itemList[i].redpot)
|
||||
redPointTypeList[self.dicData[i].RpType] = this.itemList[i].redpot
|
||||
end
|
||||
end
|
||||
this.pos4 = Vector3.New(this.off * (#this.itemList) + (#this.itemList + 1) * this.itemWidth,0,0)
|
||||
end
|
||||
|
||||
function this:SetIndex()
|
||||
for i = 1,#this.itemList do
|
||||
if this.itemList[i].pageIndex == self.curPage then
|
||||
if this.itemList[i].index == 2 then
|
||||
return
|
||||
else
|
||||
local LOY = 0
|
||||
if this.itemList[i].index - 2 > 0 then
|
||||
LOY = 3
|
||||
else
|
||||
LOY = 2
|
||||
end
|
||||
local offSet = math.abs(this.itemList[i].index - 2)
|
||||
local isenter = true
|
||||
self.thread = coroutine.start(function()
|
||||
while(offSet > 0) do
|
||||
if isenter then
|
||||
isenter = false
|
||||
this.mask:SetActive(true)
|
||||
this.MoveTo(LOY)
|
||||
Timer.New(function()
|
||||
offSet = offSet - 1
|
||||
this.SortItemList()
|
||||
isenter = true
|
||||
end,0.21):Start()
|
||||
end
|
||||
coroutine.wait(0.01)
|
||||
end
|
||||
this.mask:SetActive(false)
|
||||
this.select.gameObject:SetActive(true)
|
||||
self:RefreshJianTou()
|
||||
end)
|
||||
end
|
||||
break
|
||||
end
|
||||
this.itemList[i].img.sprite = this.spLoader:LoadSprite(self.dicData[curIndex].Icon[1])
|
||||
BindRedPointObject(self.dicData[curIndex].RpType,this.itemList[i].redpot)
|
||||
redPointTypeList[self.dicData[curIndex].RpType] = this.itemList[i].redpot
|
||||
end
|
||||
this.select.gameObject:SetActive(true)
|
||||
this:PageOnChange()
|
||||
end
|
||||
|
||||
function this:PageOnChange()
|
||||
|
@ -261,7 +383,10 @@ function this:LeftAction()
|
|||
self.lastPage = self.curPage
|
||||
self.curPage = self.nextPage
|
||||
self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1
|
||||
this:RefreshTabData()
|
||||
this.select.gameObject:SetActive(true)
|
||||
self:RefreshJianTou()
|
||||
this:PageOnChange()
|
||||
--this:RefreshTabData()
|
||||
end
|
||||
function this:RightAction()
|
||||
lastIndex = self.curPage
|
||||
|
@ -269,7 +394,10 @@ function this:RightAction()
|
|||
self.nextPage = self.curPage
|
||||
self.curPage = self.lastPage
|
||||
self.lastPage = self.curPage - 1 > 0 and self.curPage - 1 or #self.dicData
|
||||
this:RefreshTabData()
|
||||
this.select.gameObject:SetActive(true)
|
||||
self:RefreshJianTou()
|
||||
this:PageOnChange()
|
||||
--this:RefreshTabData()
|
||||
end
|
||||
|
||||
function this:OnSortingOrderChange()
|
||||
|
@ -286,6 +414,8 @@ function RecruitMainPanel:OnClose()
|
|||
ClearRedPointObject(k,v)
|
||||
end
|
||||
redPointTypeList = {}
|
||||
ClearChild(this.grid)
|
||||
this.itemList = {}
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
@ -302,6 +432,8 @@ function RecruitMainPanel:OnDestroy()
|
|||
this.spLoader:Destroy()
|
||||
SubUIManager.Close(v.sub)
|
||||
end
|
||||
ClearChild(this.grid)
|
||||
this.itemList = {}
|
||||
subViewList = {}
|
||||
self.dicData = {}
|
||||
SubUIManager.Close(this.upView)
|
||||
|
|
|
@ -394,28 +394,20 @@ local bType={
|
|||
Btn1=1,
|
||||
Btn10=2
|
||||
}
|
||||
--抽卡配置
|
||||
local preConfigure={
|
||||
[1] = {type=RecruitType.NormalSingle,privilegeId=38},
|
||||
[2] = {type=RecruitType.NormalTen},
|
||||
[3] = {type=RecruitType.FriendSingle,privilegeId=0},
|
||||
[4] = {type=RecruitType.FriendTen},
|
||||
[5] = {type=RecruitType.Single,privilegeId=14},
|
||||
[6] = {type=RecruitType.Ten}
|
||||
}
|
||||
|
||||
--点将台红点状态
|
||||
function this.GetAllRecruitBtnRedpoint(red)
|
||||
local index = {}
|
||||
if red == RedPointType.Recruit_Normal then
|
||||
index = {1,2}
|
||||
elseif red == RedPointType.Recruit_ShenJiang then
|
||||
index = {3,4}
|
||||
elseif red == RedPointType.Recruit_Friend then
|
||||
index = {3,4}
|
||||
elseif red == RedPointType.Recruit_ShenJiang then
|
||||
index = {5,6}
|
||||
end
|
||||
for i = 1,#index do
|
||||
if preConfigure[index[i]] then
|
||||
if this.GetRecruitBtnRedpoint1(preConfigure[index[i]]) then
|
||||
if PreConfigure[index[i]] then
|
||||
if this.GetRecruitBtnRedpoint1(PreConfigure[index[i]]) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -171,7 +171,7 @@ function SingleRecruitPanel:BindEvent()
|
|||
-- self:ClosePanel()
|
||||
-- UIManager.OpenPanel(UIName.TenRecruitPanel,heroData,type,recruitType)
|
||||
end
|
||||
this.jumpBtnGo:SetActive(false)
|
||||
this.jumpPanel:SetActive(false)
|
||||
this.StopPanelSound()
|
||||
end)
|
||||
--确定按钮
|
||||
|
@ -230,7 +230,7 @@ function SingleRecruitPanel:OnOpen(...)
|
|||
this.UI_Effect_choukaR:SetActive(false)
|
||||
this.UI_Effect_appear:SetActive(false)
|
||||
this.rolePanel:SetActive(false)
|
||||
this.jumpBtnGo:SetActive(false)
|
||||
this.jumpPanel:SetActive(false)
|
||||
local data={...}
|
||||
heroData=data[1]
|
||||
type=data[2]
|
||||
|
@ -253,9 +253,9 @@ function SingleRecruitPanel:OnShow()
|
|||
end
|
||||
index=0
|
||||
if recruitType[1] == RecruitType.XiangYaoSingle or recruitType[1] == RecruitType.XiangYaoTen then
|
||||
this.jumpBtnGo:SetActive(false)
|
||||
this.jumpPanel:SetActive(false)
|
||||
else
|
||||
this.jumpBtnGo:SetActive(true)
|
||||
this.jumpPanel:SetActive(true)
|
||||
end
|
||||
if state==1 then --单抽
|
||||
if lotterySetting[type] and lotterySetting[type].LotteryType == 11 then
|
||||
|
@ -348,7 +348,7 @@ function SingleRecruitPanel:UpdataPanelData(_heroData)
|
|||
-- local time2 = Timer.New(function ()
|
||||
this.CloseAllTimer()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.UI.OnUpdateData, self.uiConfig.id)
|
||||
this.jumpBtnGo:SetActive(false)
|
||||
this.jumpPanel:SetActive(false)
|
||||
this.UI_Effect_appear:SetActive(false)
|
||||
Sound_Recruit3 = SoundManager.PlaySound(SoundConfig.Sound_Recruit3)
|
||||
|
||||
|
|
Loading…
Reference in New Issue