From 5ac2ed1220a59506321430fa3e7ba221fc301547 Mon Sep 17 00:00:00 2001 From: wangzhenxing <1545929779@qq.com> Date: Mon, 24 Jul 2023 11:31:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=B1=E6=B2=B3=E8=AE=BE=E8=AE=A1=E5=9B=BE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=B3=E5=8D=A1=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FightLevel/FightLevelChapterPanel.prefab | 84 ++++++++++++++++++- .../FightLevel/FightLevelChapterPanel.lua | 24 ++++++ 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/FightLevel/FightLevelChapterPanel.prefab b/Assets/ManagedResources/Prefabs/UI/FightLevel/FightLevelChapterPanel.prefab index 130b99c7fb..5900e9658a 100644 --- a/Assets/ManagedResources/Prefabs/UI/FightLevel/FightLevelChapterPanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/FightLevel/FightLevelChapterPanel.prefab @@ -43668,7 +43668,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0} - m_AnchoredPosition: {x: 0, y: 57.700012} + m_AnchoredPosition: {x: -444, y: 1819} m_SizeDelta: {x: 160, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2468755917181465753 @@ -43706,7 +43706,7 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 4 m_MaxSize: 40 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 @@ -44150,6 +44150,7 @@ RectTransform: - {fileID: 5508372000661152921} - {fileID: 1647788101} - {fileID: 5972340744719157198} + - {fileID: 3492279594617188233} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -46064,3 +46065,82 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &7279998188306281387 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3492279594617188233} + - component: {fileID: 982289915022788493} + - component: {fileID: 2562656429533855085} + m_Layer: 5 + m_Name: maxTxt2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3492279594617188233 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7279998188306281387} + 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: 2461825146493731649} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -391.8, y: 1779.3} + m_SizeDelta: {x: 264.3, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &982289915022788493 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7279998188306281387} + m_CullTransparentMesh: 0 +--- !u!114 &2562656429533855085 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7279998188306281387} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8396226, g: 0.10428036, b: 0.059407253, 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_FontData: + m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3} + m_FontSize: 40 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 4 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: "\u4ECA\u65E5\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u5173\u5361\u5C06\u4E0E\u6B21\u65E5\u5F00\u542F" diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua index 3944eb6708..54571cdb99 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua @@ -11,6 +11,8 @@ function FightLevelChapterPanel:InitComponent() this.spLoader = SpriteLoader.New() self.btnBack = Util.GetGameObject(self.gameObject, "btnBack") this.hintTxt = Util.GetGameObject(self.gameObject, "hintTxt"):GetComponent("Text") + this.maxTxt = Util.GetGameObject(self.gameObject, "maxTxt2"):GetComponent("Text") + this.maxTxt.gameObject:SetActive(true) self.sortBtn = Util.GetGameObject(self.gameObject, "sortBtn") self.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn") self.helpPos = self.helpBtn:GetComponent("RectTransform").localPosition @@ -98,16 +100,38 @@ end function this.OnShowPanel() local curTime=GetTimeStamp() local hint + local maxChapterId=0 + local day=0 + local allChapterId=0 for _, config in ConfigPairs(chapterConfig) do if curTime>PlayerManager.GetServerOpenTime()+config.OpenTime*24*60*60 then hint=config.OpenNumber + --if maxChapterId==0 then + if day~=config.OpenTime-1 then + day=config.OpenTime-1 + maxChapterId=config.Id + end + allChapterId=config.Id + --maxChapterId=config.Id + --end end end this.hintTxt.text=hint SoundManager.PlayMusic(SoundConfig.BGM_Main) this.starNumText.text = FightLevelManager.GetAllChapterStars() curChapterId = FightLevelManager.GetCurChapterId() + LogError("curChapterId========="..curChapterId.." maxChapterId=="..maxChapterId) + this.maxTxt.gameObject:SetActive(false) + if curChapterId==maxChapterId then + LogError("11111111111111111111111111111111111111") + this.maxTxt.gameObject:SetActive(true) + this.maxTxt.text="今日已达上限,关卡将与次日开启" + end + if curChapterId==allChapterId then + this.maxTxt.gameObject:SetActive(true) + this.maxTxt.text="已达最终关卡" + end local allData = FightLevelManager.GetChapterData() this.ScrollView:SetData(allData, function (index, go) this.SingleChapterDataShow(go, allData[index],index)