From 9add8d8dbf8b0fe199b17ea6b059fff3270ebce1 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Tue, 27 Oct 2020 12:02:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=95=86=E5=BA=97=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DShopView=E9=94=80=E6=AF=81=E6=97=B6=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=85=B6=E4=BB=96shopview=E7=89=A9=E5=93=81=E5=9B=9E?= =?UTF-8?q?=E6=94=B6=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=95=86=E5=BA=97=E5=81=B6=E7=8E=B0=E7=89=A9=E5=93=81=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TagAtlas/r_shangdian_xuanyuan.png.meta | 88 +++++++++++++++++++ .../ManagedResources/~Lua/View/ShopView.lua | 71 ++++++++------- 2 files changed, 129 insertions(+), 30 deletions(-) create mode 100644 Assets/ManagedResources/Atlas/TagAtlas/r_shangdian_xuanyuan.png.meta diff --git a/Assets/ManagedResources/Atlas/TagAtlas/r_shangdian_xuanyuan.png.meta b/Assets/ManagedResources/Atlas/TagAtlas/r_shangdian_xuanyuan.png.meta new file mode 100644 index 0000000000..ea9c656bf5 --- /dev/null +++ b/Assets/ManagedResources/Atlas/TagAtlas/r_shangdian_xuanyuan.png.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 0becfb702d9034b42a066aa225fdeb27 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: c9e50b79681466840af4ae85b937b4d3 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: TagAtlas + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/~Lua/View/ShopView.lua b/Assets/ManagedResources/~Lua/View/ShopView.lua index 4f4177ee27..dd20c54e7b 100644 --- a/Assets/ManagedResources/~Lua/View/ShopView.lua +++ b/Assets/ManagedResources/~Lua/View/ShopView.lua @@ -4,8 +4,7 @@ local _ShopTypeConfig = ConfigManager.GetConfig(ConfigName.StoreTypeConfig) local ShopView = {} local this = ShopView this.sortingOrder = 0 --- 保存商品中的物品节点 -local _GoodsItemList = {} +local isPlayShow = true ---===============================生命周期函数================================ function this:New(gameObject) local o = {} @@ -80,6 +79,8 @@ end function this:BindEvent() local localSelf = self Util.AddOnceClick(self.refreshBtn, function() + PlaySoundWithoutClick("UI_refresh") + isPlayShow = true local isPopUp = RedPointManager.PlayerPrefsGetStr(PlayerManager.uid .. localSelf.ShopType) local currentTime = os.date("%Y%m%d", PlayerManager.serverTime) local shopType = localSelf.ShopType @@ -136,12 +137,14 @@ function this:OnClose() -- 物品节点回收 - for _, item in pairs(_GoodsItemList) do - Util.SetColor(item.gameObject, Color.New(1,1,1,1)) - Util.SetGray(item.gameObject, false) - SubUIManager.Close(item) + if self._GoodsItemList then + for _, item in pairs(self._GoodsItemList) do + Util.SetColor(item.gameObject, Color.New(1,1,1,1)) + Util.SetGray(item.gameObject, false) + SubUIManager.Close(item) + end + self._GoodsItemList = {} end - _GoodsItemList = {} -- 红点销毁 -- if self.ShopType == SHOP_TYPE.GENERAL_SHOP then @@ -189,8 +192,10 @@ function this:RefreshShopInfo(isRefresh, isTop) if isRefresh then -- 物品节点播放特效 - for _, item in pairs(_GoodsItemList) do - item:OnShowUIeffectItemViewSaoguang() + if self._GoodsItemList then + for _, item in pairs(self._GoodsItemList) do + item:OnShowUIeffectItemViewSaoguang() + end end end end @@ -382,17 +387,17 @@ function this:RefreshItemList(isTop) self.RechargeScrollView:SetData(itemlist, function(index, shopItem) local itemData = itemlist[index] self:RechargeShopItemAdapter(shopItem, itemData) + if isPlayShow then + shopItem.gameObject:SetActive(false) + end end) if isTop then self.RechargeScrollView:SetIndex(1) end - self.RechargeScrollView:ForeachItemGO(function (index, go) - Timer.New(function () - go.gameObject:SetActive(true) - PlayUIAnim(go.gameObject) - end, 0.03*(index-1)):Start() - end) - + if isPlayShow then + SecTorPlayAnimByScroll(self.RechargeScrollView,0.03) + isPlayShow = false + end else -- 重置列表 self.RechargeScrollView.gameObject:SetActive(false) @@ -401,17 +406,17 @@ function this:RefreshItemList(isTop) self.ScrollView:SetData(itemlist, function(index, shopItem) local itemData = itemlist[index] self:ShopItemAdapter(shopItem, itemData) + if isPlayShow then + shopItem.gameObject:SetActive(false) + end end) if isTop then self.ScrollView:SetIndex(1) end - self.ScrollView:ForeachItemGO(function (index, go) - Timer.New(function () - go.gameObject:SetActive(true) - PlayUIAnim(go.gameObject) - end, 0.03*(index-1)):Start() - end) - + if isPlayShow then + SecTorPlayAnimByScroll(self.ScrollView,0.03) + isPlayShow = false + end end end @@ -481,14 +486,17 @@ function this:ShopItemAdapter(shopItem, itemData) empty:SetActive(isEmpty) -- 数据匹配 - if not _GoodsItemList[shopItem] then - _GoodsItemList[shopItem] = SubUIManager.Open(SubUIConfig.ItemView, item.transform) + if not self._GoodsItemList then + self._GoodsItemList = {} end - Util.SetGray(_GoodsItemList[shopItem].gameObject, not _IsUnLock) + if not self._GoodsItemList[shopItem] then + self._GoodsItemList[shopItem] = SubUIManager.Open(SubUIConfig.ItemView, item.transform) + end + Util.SetGray(self._GoodsItemList[shopItem].gameObject, not _IsUnLock) if isEmpty or not _IsUnLock then -- 物品空或者未解锁不现实物品特效 - _GoodsItemList[shopItem]:OnOpen(false, goods[1],1,false,false,false) + self._GoodsItemList[shopItem]:OnOpen(false, goods[1],1,false,false,false) else - _GoodsItemList[shopItem]:OnOpen(false, goods[1],1,false,false,false,this.sortingOrder) + self._GoodsItemList[shopItem]:OnOpen(false, goods[1],1,false,false,false,this.sortingOrder) end -- 商品颜色显示 @@ -547,6 +555,8 @@ function this:RechargeShopItemAdapter(shopItem, itemData) self:RechargeSuccessFunc(itemData.goodsId) end) end) + + end -- 充值成功回调 @@ -579,6 +589,7 @@ function this:ShowShop(shopType,_sortingOrder) -- 刷新显示 self.ShopType = shopType + isPlayShow = true self.ShopId = ShopManager.GetShopDataByType(self.ShopType).id self.ShopConfig = _ShopTypeConfig[self.ShopId] -- 显示帮助按钮 @@ -624,8 +635,8 @@ end -- 设置层级 function this:SetSortLayer(sortLayer) -- - Log("sortLayer _GoodsItemList "..sortLayer.." "..LengthOfTable(_GoodsItemList)) - for _, item in pairs(_GoodsItemList) do + Log("sortLayer _GoodsItemList "..sortLayer.." "..LengthOfTable(self._GoodsItemList)) + for _, item in pairs(self._GoodsItemList) do item:SetEffectLayer(sortLayer)--this.sortingOrder) end