require("Base/BasePanel") ElementDrawCardPanel = Inherit(BasePanel) local canDrag=true local i=1 local this=ElementDrawCardPanel local orginLayer local AllActSetConfig = ConfigManager.GetConfig(ConfigName.GlobalSystemConfig) local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting) local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local itemId=20 --元素神符 --初始化组件(用于子类重写) function ElementDrawCardPanel:InitComponent() this.getCardPanelList = {} this.spLoader = SpriteLoader.New() orginLayer = 0 this.btnBack=Util.GetGameObject(self.gameObject, "enterCardPanel/btnBack") this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft, panelType = PanelType.ElementDrawCard }) this.item1BuyOneBtn=Util.GetGameObject(self.transform, "getCardPanel1/content2/btn1") -- this.item1BuyTenBtn=Util.GetGameObject(self.transform, "getCardPanel1/content2/btn10") this.item2BuyOneBtn=Util.GetGameObject(self.transform, "getCardPanel2/content2/btn1") -- this.item2BuyTenBtn=Util.GetGameObject(self.transform, "getCardPanel2/content2/btn10") this.item3BuyOneBtn=Util.GetGameObject(self.transform, "getCardPanel3/content2/btn1") -- this.item3BuyTenBtn=Util.GetGameObject(self.transform, "getCardPanel3/content2/btn10") this.item4BuyOneBtn=Util.GetGameObject(self.transform, "getCardPanel4/content2/btn1") -- this.item4BuyTenBtn=Util.GetGameObject(self.transform, "getCardPanel4/content2/btn10") -- this.item5BuyOneBtn=Util.GetGameObject(self.transform, "getCardPanel5/content2/btn1") -- this.item5BuyTenBtn=Util.GetGameObject(self.transform, "getCardPanel5/content2/btn10") this.itemBtn1=Util.GetGameObject(self.transform, "enterCardPanel/item1") this.itemBtn2=Util.GetGameObject(self.transform, "enterCardPanel/item2") this.itemBtn3=Util.GetGameObject(self.transform, "enterCardPanel/item3") this.itemBtn4=Util.GetGameObject(self.transform, "enterCardPanel/item4") -- this.itemBtn5=Util.GetGameObject(self.transform, "enterCardPanel/item5") this.getCardPanel1=Util.GetGameObject(self.transform, "getCardPanel1") this.getCardPanel2=Util.GetGameObject(self.transform, "getCardPanel2") this.getCardPanel3=Util.GetGameObject(self.transform, "getCardPanel3") this.getCardPanel4=Util.GetGameObject(self.transform, "getCardPanel4") table.insert(this.getCardPanelList,this.getCardPanel1) table.insert(this.getCardPanelList,this.getCardPanel2) table.insert(this.getCardPanelList,this.getCardPanel3) table.insert(this.getCardPanelList,this.getCardPanel4) -- this.getCardPanel5=Util.GetGameObject(self.transform, "getCardPanel5") this.getCardPanelBtnBack1=Util.GetGameObject(self.transform, "getCardPanel1/btnBack") this.getCardPanelBtnBack2=Util.GetGameObject(self.transform, "getCardPanel2/btnBack") this.getCardPanelBtnBack3=Util.GetGameObject(self.transform, "getCardPanel3/btnBack") this.getCardPanelBtnBack4=Util.GetGameObject(self.transform, "getCardPanel4/btnBack") -- this.getCardPanelBtnBack5=Util.GetGameObject(self.transform, "getCardPanel5/btnBack") this.effect=Util.GetGameObject(self.transform, "effect") this.bgImage=Util.GetGameObject(self.transform, "bgImage") self.previewBtn = Util.GetGameObject(self.transform, "previewBtn") self.shopBtn = Util.GetGameObject(self.transform, "shopBtn") self.helpBtn = Util.GetGameObject(self.transform, "helpBtn") self.exchangeBtn = Util.GetGameObject(self.transform, "exchangeBtn") screenAdapte(this.bgImage) -- RecruitManager.GetRewardPreviewData() end --绑定事件(用于子类重写) function ElementDrawCardPanel:BindEvent() Util.AddClick(this.btnBack, function () self:ClosePanel() --UIManager.OpenPanel(UIName.MainPanel) end) Util.AddClick(this.item1BuyOneBtn, function () if BagManager.GetItemCountById(itemId)