【bug】修复ScrollCycleView回收导致报错的问题
parent
8750406dfc
commit
7198279fcc
|
|
@ -16,6 +16,15 @@ function TrialRewardPopup:InitComponent()
|
|||
this.scroll=Util.GetGameObject(this.panel,"Scroll")
|
||||
pres[1]=Util.GetGameObject(this.panel,"Scroll/Pre")
|
||||
pres[2]=Util.GetGameObject(this.panel,"Scroll/Pre3")
|
||||
|
||||
scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,pres[MonsterCampManager.preType], nil,
|
||||
Vector2.New(this.scroll.transform.rect.width,this.scroll.transform.rect.height),1,1,Vector2.New(0,5))
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||
scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||
scrollView.moveTween.MomentumAmount = 1
|
||||
scrollView.moveTween.Strength = 2
|
||||
end
|
||||
|
||||
function TrialRewardPopup:BindEvent()
|
||||
|
|
@ -43,26 +52,17 @@ function TrialRewardPopup:OnOpen(...)
|
|||
end
|
||||
|
||||
function TrialRewardPopup:OnShow()
|
||||
scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,pres[MonsterCampManager.preType], nil,
|
||||
Vector2.New(this.scroll.transform.rect.width,this.scroll.transform.rect.height),1,1,Vector2.New(0,5))
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||
scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||
scrollView.moveTween.MomentumAmount = 1
|
||||
scrollView.moveTween.Strength = 2
|
||||
this.RefreshPanel(true,true)
|
||||
sortingOrder = self.sortingOrder
|
||||
end
|
||||
|
||||
function TrialRewardPopup:OnClose()
|
||||
--GameObject.DestroyImmediate(scrollView.gameObject)
|
||||
SubUIManager.Close(scrollView)
|
||||
itemList = {}
|
||||
end
|
||||
|
||||
function TrialRewardPopup:OnDestroy()
|
||||
scrollView=nil
|
||||
itemList = {}
|
||||
end
|
||||
|
||||
--0 已经领取,1 可领取,2不能领取·
|
||||
|
|
|
|||
Loading…
Reference in New Issue