From 416ba72c2f15f382fc9a36cf5270f3c1426a54bd Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Mon, 13 Jul 2020 16:41:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=AE=E7=BD=97=E5=B0=8F=E6=B8=B8=E6=88=8Fbu?= =?UTF-8?q?g=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/Map/TrialMiniGamePanel.prefab | 130 ++++++++++++++++-- .../Map/TrialMiniGame/Logic/Game_14.lua | 13 +- .../Map/TrialMiniGame/Logic/Game_16.lua | 5 + .../Map/TrialMiniGame/Logic/Game_17.lua | 11 +- .../Map/TrialMiniGame/Logic/Game_18.lua | 6 + 5 files changed, 150 insertions(+), 15 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Map/TrialMiniGamePanel.prefab b/Assets/ManagedResources/Prefabs/UI/Map/TrialMiniGamePanel.prefab index 072fab321b..d8741fd901 100644 --- a/Assets/ManagedResources/Prefabs/UI/Map/TrialMiniGamePanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Map/TrialMiniGamePanel.prefab @@ -681,7 +681,8 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 3472270698266781006} + - component: {fileID: 3470195748214042733} + - component: {fileID: 3438442689703484279} m_Layer: 0 m_Name: Game_18 m_TagString: Untagged @@ -689,8 +690,8 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!4 &3472270698266781006 -Transform: +--- !u!224 &3470195748214042733 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} @@ -704,10 +705,24 @@ Transform: - {fileID: 6154318554534933948} - {fileID: 6181458139143078872} - {fileID: 4187306671584326201} + - {fileID: 5726404457783881133} - {fileID: 9077118300160263819} m_Father: {fileID: 1280518217681842888} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1080, y: 1897} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3438442689703484279 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 91198398964448359} + m_CullTransparentMesh: 0 --- !u!1 &120764374100435940 GameObject: m_ObjectHideFlags: 0 @@ -1260,6 +1275,7 @@ GameObject: m_Component: - component: {fileID: 8343060592706080390} - component: {fileID: 8925629893475097646} + - component: {fileID: 1204353047038332442} m_Layer: 5 m_Name: icon m_TagString: Untagged @@ -1294,6 +1310,35 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 674705665733374592} m_CullTransparentMesh: 0 +--- !u!114 &1204353047038332442 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 674705665733374592} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 --- !u!1 &678146947055905716 GameObject: m_ObjectHideFlags: 0 @@ -1743,7 +1788,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1544318702661827868} - m_Father: {fileID: 3472270698266781006} + m_Father: {fileID: 3470195748214042733} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2189,8 +2234,8 @@ RectTransform: m_LocalScale: {x: 2.9121184, y: 2.9121184, z: 2.9121184} m_Children: - {fileID: 760474955983389260} - m_Father: {fileID: 3472270698266781006} - m_RootOrder: 4 + m_Father: {fileID: 3470195748214042733} + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -3934,7 +3979,7 @@ RectTransform: - {fileID: 6453343601413579126} - {fileID: 1333514904258367921} - {fileID: 2499330597335303844} - m_Father: {fileID: 3472270698266781006} + m_Father: {fileID: 3470195748214042733} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -6369,7 +6414,7 @@ RectTransform: - {fileID: 787863531} - {fileID: 5695942863401039707} - {fileID: 948311900591901430} - - {fileID: 3472270698266781006} + - {fileID: 3470195748214042733} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -7370,7 +7415,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 3472270698266781006} + m_Father: {fileID: 3470195748214042733} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -12214,7 +12259,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 3472270698266781006} + m_Father: {fileID: 3470195748214042733} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -15010,6 +15055,71 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8980922047069217908} m_CullTransparentMesh: 0 +--- !u!1 &8986016928859608297 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5726404457783881133} + - component: {fileID: 7165313727292324804} + - component: {fileID: 1638231052686179209} + m_Layer: 0 + m_Name: empty + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &5726404457783881133 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8986016928859608297} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3470195748214042733} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7165313727292324804 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8986016928859608297} + m_CullTransparentMesh: 0 +--- !u!114 &1638231052686179209 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8986016928859608297} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e459a084d8e15a240b58db751097122b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null --- !u!1 &9010989798139851598 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_14.lua b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_14.lua index efc4ce7bef..03d335df83 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_14.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_14.lua @@ -2,6 +2,7 @@ local this = Game_14 local _itemsList = {} local _iconList = {} +local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) function this.Init(context, root, gameType, gameId, gameParams) this.root = root this.gameType = gameType @@ -30,13 +31,19 @@ function this.Show() if not _itemsList[index] then _itemsList[index] = newObjToParent(this.itemPre, this.itemsLayout) - local icon = Util.GetGameObject(_itemsList[index], "icon") + local icon = Util.GetGameObject(_itemsList[index], "icon"):GetComponent("Image") local btnSure = Util.GetGameObject(_itemsList[index], "btnAns") + local data = ConfigManager.GetConfigDataByKey(ConfigName.HeroConfig,"Id",tonumber(answerId)) + + -- if not _iconList[index] then + -- _iconList[index] = SubUIManager.Open(SubUIConfig.ItemView,icon.transform) + -- end + -- _iconList[index]:OnOpen(false,{answerId,1},1.1,false) if not _iconList[index] then - _iconList[index] = SubUIManager.Open(SubUIConfig.ItemView,icon.transform) + _iconList[index] = icon end - _iconList[index]:OnOpen(false,{answerId,1},1.1,false) + _iconList[index].sprite = Util.LoadSprite(GetResourcePath(data.Icon)) Util.AddOnceClick(btnSure, function() this.ChooseAnswer(index) diff --git a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_16.lua b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_16.lua index ab4b82a02f..97f09c9981 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_16.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_16.lua @@ -7,14 +7,17 @@ function this.Init(context, root, gameType, gameId, gameParams) this.TrialGameConfig = ConfigManager.GetConfig(ConfigName.TrialGameConfig) this.Text = Util.GetGameObject(this.root, "middle/startDraw/canRechargeTimebg/Text"):GetComponent("Text") this.startDrawBtn = Util.GetGameObject(this.root, "middle/startDraw/startDrawBtn") + this.startDrawBtn:GetComponent("Button").interactable = true this.anim = Util.GetGameObject(this.root, "middle/number/anim") this.anim.transform.localPosition = Vector2.New(18, -58) this.NumView = SubUIManager.Open(SubUIConfig.NumberView, this.anim.transform, "r_fxgz_shuzi_", Vector2.New(80, 120), Vector2.New(50, 30), 0, 99999) + end function this.Show() this.root:SetActive(true) Util.AddOnceClick(this.startDrawBtn,function() + this.startDrawBtn:GetComponent("Button").interactable = false this.OnRefreshItemNumShow(this.gameId) end) end @@ -25,6 +28,7 @@ function this.OnRefreshItemNumShow(index) --ToDo动画显示 this.NumView:SetNum(0) this.NumView:DOItemNum(dropNumbers, function(index, num, item) + -- itemList[index]=item item:Move(tostring(num), index * 0.5 + 2, true, 3) end) local timerEffect = Timer.New(function() @@ -34,6 +38,7 @@ function this.OnRefreshItemNumShow(index) -- end if TrialMiniGameManager.IsGameDone() then TrialMiniGameManager.EndGame() + this.NumView.gameObject:SetActive(false) end local data = TrialMiniGameManager.IdToNameIconNum(msg.drop.itemlist[1].itemId,msg.drop.itemlist[1].itemNum) PopupTipPanel.ShowColorTip(data[1],data[2],data[3]) diff --git a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_17.lua b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_17.lua index d9918fdcf7..e394054141 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_17.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_17.lua @@ -12,6 +12,7 @@ function this.Init(context, root, gameType, gameId, gameParams) this.list={}--Id的List this.items = Util.GetGameObject(this.root,"items") this.btnStart = Util.GetGameObject(this.root,"Button") + this.btnStart:GetComponent("Button").interactable = true this.itemsList = {}--12个框的List\ this.ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) this.ArtConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) @@ -29,7 +30,9 @@ end function this.Show() this.root:SetActive(true) - this.liveNode = poolManager:LoadLive("live2d_c_yj_00040", this.liveRoot.transform, Vector3.one, Vector3.New(0,200, 0)) + this.liveNode = poolManager:LoadLive("live2d_c_yj_00040", this.liveRoot.transform, Vector3.one, Vector3.New(0,200, 0)) + local red = Util.GetGameObject(this.itemsList[1],"Red") + red:SetActive(true) for index, item in pairs(this.itemsList) do local reward = Util.GetGameObject(item,"reward"):GetComponent("Image") @@ -53,7 +56,7 @@ function this.Show() end local data = TrialMiniGameManager.IdToNameIconNum(msg.drop.itemlist[1].itemId,msg.drop.itemlist[1].itemNum) PopupTipPanel.ShowColorTip(data[1],data[2],data[3]) - end, 4,1,true):Start() + end, 3,1,true):Start() end) end) end @@ -97,6 +100,10 @@ end function this.Close() this.root:SetActive(false) + for index, value in ipairs(this.itemsList) do + local red = Util.GetGameObject(this.itemsList[index],"Red") + red:SetActive(false) + end poolManager:UnLoadLive("live2d_c_yj_00040", this.liveNode) index = 1 if this.turnEffect2 then diff --git a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_18.lua b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_18.lua index d5b2b8a8ea..4ba19276d3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_18.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/TrialMiniGame/Logic/Game_18.lua @@ -19,6 +19,7 @@ function this.Init(context, root, gameType, gameId, gameParams) this.itemsLayout = Util.GetGameObject(root, "Layout") this.itemPre = Util.GetGameObject(root, "Layout/itemPre") this.btn = Util.GetGameObject(root, "btnStart") + this.empty = Util.GetGameObject(root, "empty") this.gameConfig = ConfigManager.GetConfig(ConfigName.TrialGameConfig) this.itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) this.atrConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) @@ -30,6 +31,7 @@ end function this.Show() this.root:SetActive(true) + this.empty:SetActive(true) this.liveNode = poolManager:LoadLive("live2d_c_yj_00040", this.liveRoot.transform, Vector3.one * 0.75, Vector3.New(0,190, 0)) --数据乱序操作 @@ -42,6 +44,7 @@ function this.Show() Util.AddOnceClick(this.btn,function()--所有的 正->背 local thread=coroutine.start(function() + this.empty:SetActive(true) this.btn:SetActive(false) for index, value in ipairs(_itemsList) do local cFront = Util.GetGameObject(_itemsList[index], "front") @@ -63,6 +66,7 @@ function this.Show() --重新发牌 isActive = false this.SetCard(this.gameParams) + this.empty:SetActive(false) end) end) @@ -71,6 +75,7 @@ function this.Show() local cBack = Util.GetGameObject(_itemsList[index], "back") Util.AddOnceClick(cBack,function() local thread=coroutine.start(function() + this.empty:SetActive(true) cBack.transform:DORotate(Vector3.New(0, 90, 0), 0.3) coroutine.wait(0.3) cFront.transform:DORotate(Vector3.New(0, 0, 0), 0.3) @@ -89,6 +94,7 @@ function this.Show() end end end) + this.empty:SetActive(false) end) end)