diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/TrialRewardPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/TrialRewardPopup.lua index 82959a4c69..edc860225f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/TrialRewardPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/TrialRewardPopup.lua @@ -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不能领取·