From 88c2e3984ec7a3fb1fba6bad7a22ec2374b4416e Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Tue, 10 Aug 2021 20:20:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AF=BB=E5=AE=9D=E8=BF=B7=E8=B8=AA?= =?UTF-8?q?=E3=80=91=E5=A2=9E=E5=8A=A0=E8=BF=9B=E5=85=A5=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E9=BB=91=E8=BE=B9=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XunBaoMiZong/XunBaoMiZongMapPanel.prefab | 126 ++++++++++++++++++ .../~Lua/Modules/Message/SwitchPanel.lua | 6 +- .../XunBaoMiZong/XunBaoMiZongMapPanel.lua | 23 +++- .../XunBaoMiZong/XunBaoMiZongPanel.lua | 3 +- 4 files changed, 150 insertions(+), 8 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/XunBaoMiZong/XunBaoMiZongMapPanel.prefab b/Assets/ManagedResources/Prefabs/UI/XunBaoMiZong/XunBaoMiZongMapPanel.prefab index 10b3098296..b8e9ded876 100644 --- a/Assets/ManagedResources/Prefabs/UI/XunBaoMiZong/XunBaoMiZongMapPanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/XunBaoMiZong/XunBaoMiZongMapPanel.prefab @@ -437,6 +437,7 @@ RectTransform: - {fileID: 6697885432122366250} - {fileID: 6697897309647561934} - {fileID: 6697787164710513212} + - {fileID: 4074586898896125412} m_Father: {fileID: 6697065354150255466} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1104,3 +1105,128 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1001 &1897680427161435773 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 6696865751648667954} + m_Modifications: + - target: {fileID: 2512513232103719832, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_Name + value: UI_Effect_YJBK_Zao + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_AnchoredPosition.x + value: -3.9000013 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 159.50003 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_SizeDelta.x + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_SizeDelta.y + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f8f667448c1347349b61fc8e50fe06da, type: 3} +--- !u!224 &4074586898896125412 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2512513232103719833, guid: f8f667448c1347349b61fc8e50fe06da, + type: 3} + m_PrefabInstance: {fileID: 1897680427161435773} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/ManagedResources/~Lua/Modules/Message/SwitchPanel.lua b/Assets/ManagedResources/~Lua/Modules/Message/SwitchPanel.lua index a640ce8507..6f6031af52 100644 --- a/Assets/ManagedResources/~Lua/Modules/Message/SwitchPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Message/SwitchPanel.lua @@ -30,7 +30,7 @@ function this:OnOpen(...) end -function this.OpenPanel(id, func) +function this.OpenPanel(id, func,data) -- local args = {...} UIManager.OpenPanel(UIName.SwitchPanel) DoTween.To(DG.Tweening.Core.DOGetter_float( function () return 6 end), @@ -38,7 +38,9 @@ function this.OpenPanel(id, func) this.CircleMaskMat:SetFloat("_R", progress) end), 0, 1):SetEase(Ease.OutQuad):OnComplete(function () -- UIManager.OpenPanel(id, unpack(args, table.maxn(args))) - UIManager.OpenPanel(id) + if id then + UIManager.OpenPanel(id,data) + end UIManager.OpenPanel(UIName.SwitchPanel) if func then func() end DoTween.To(DG.Tweening.Core.DOGetter_float( function () return 0 end), diff --git a/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongMapPanel.lua b/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongMapPanel.lua index d18fca507d..898ef515fb 100644 --- a/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongMapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongMapPanel.lua @@ -19,12 +19,16 @@ function XunBaoMiZongMap:InitComponent() self.selectMap = Util.GetGameObject(self.gameObject, "mapParent/selectMap") self.roleRoot = Util.GetGameObject(self.gameObject, "mapParent/selectMap/Image (1)/roleRoot") self.btnGet = Util.GetGameObject(self.gameObject, "mapParent/btnGet"):GetComponent("Image") + self.effect = Util.GetGameObject(self.gameObject, "mapParent/UI_Effect_YJBK_Zao") + self.effect:SetActive(false) end --绑定事件(用于子类重写) function XunBaoMiZongMap:BindEvent() Util.AddClick(self.btnBack, function() - self:ClosePanel() + SwitchPanel.OpenPanel(nil,function () + self:ClosePanel() + end) end) Util.AddClick(self.btnGet.gameObject, function() local distance = math.distanceXY(self.rewardPos,self.oldPos) @@ -32,9 +36,15 @@ function XunBaoMiZongMap:BindEvent() if distance <= tonumber(banjing) then local Id = ConfigManager.GetConfigDataByKey(ConfigName.LotterySetting,"ActivityId",self.actData.activityId).Id NetManager.RecruitRequest(Id,function (msg) - UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() - self:ClosePanel() - end) + self.effect:SetActive(true) + Timer.New(function () + self.effect:SetActive(false) + UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() + SwitchPanel.OpenPanel(nil,function () + self:ClosePanel() + end) + end) + end,1.5):Start() end) else PopupTipPanel.ShowTip("请根据箭头找到宝藏!") @@ -103,11 +113,14 @@ function XunBaoMiZongMap:LoadMapData() SetTextVerTial(Util.GetGameObject(go, "name"):GetComponent("Text"),Vector3.New(40.02,9.55,0)) local passImage = Util.GetGameObject(go, "passImage"):SetActive(false)--关闭”通“字 end - self.oldPos = Vector3.New(2487,-2536,10) + self.oldPos = Vector3.New(2487,-2536,10)--设置初始位置 self:SelectRenPos(Util.GetTransform(self.mapRoot, "uiObj#"),self.oldPos) self.curRewardPointData = ConfigManager.GetConfigData(ConfigName.MainLevelSettingConfig,math.random(1,15)) Log("当前奖励点名字:"..tostring(self.curRewardPointData.Name)) self.rewardPos = Vector2.New(self.curRewardPointData.ChapterCenterPosition[1],self.curRewardPointData.ChapterCenterPosition[2]) + self.effect.transform:SetParent(Util.GetTransform(self.mapRoot, "uiObj#")) + self.effect:GetComponent("RectTransform").anchoredPosition3D = Vector3.New(self.rewardPos.x, self.rewardPos.y, 10) + self.effect:GetComponent("RectTransform").localScale = Vector2.one * 1.5 end function XunBaoMiZongMap:SelectRenPos(_parent,ChapterRolePosition) diff --git a/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongPanel.lua b/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongPanel.lua index 8f69753f33..9ec225753d 100644 --- a/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/XunBaoMiZong/XunBaoMiZongPanel.lua @@ -45,7 +45,8 @@ function XunBaoMiZong:BindEvent() Util.AddOnceClick(self.btnGO,function () NetManager.XunBaoMiZongEnterMap(function (msg) if msg.isEnter then - UIManager.OpenPanel(UIName.XunBaoMiZongMapPanel,self.actData) + SwitchPanel.OpenPanel(UIName.XunBaoMiZongMapPanel,nil,self.actData) + -- UIManager.OpenPanel(UIName.XunBaoMiZongMapPanel,self.actData) else PopupTipPanel.ShowTip("宝图碎片不足,无法开启寻宝!") end