From a06e738ef41af916663e498ecd3435b2a612b670 Mon Sep 17 00:00:00 2001 From: Ino Date: Tue, 4 Feb 2025 08:40:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9B=A8=EC=9D=B4=EB=B8=8C=20=EC=A0=90?= =?UTF-8?q?=EC=88=98=20=EC=9D=BC=EC=A0=95=20=EC=9D=B4=EC=83=81=20=EB=B3=B4?= =?UTF-8?q?=EC=83=81=20=EC=A7=80=EA=B8=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIPrefabs/Dungeon/WaveRewardCard.cs | 35 +- .../UIPrefabs/Dungeon/WaveRewardCard.prefab | 298 ++++++++++++++++++ .../Table/Dungeon/table_waverewardlist.cs | 7 + Assets/Script/UI/Dungeon/WaveRewardUI.cs | 5 +- Assets/Script/UI/Map/MapChoiceUI_Dungeon.cs | 1 - .../Script/UI/Map/MapChoiceUI_Dungeon_Wave.cs | 9 + 6 files changed, 347 insertions(+), 8 deletions(-) diff --git a/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.cs b/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.cs index edd9d5495..43fa0bab9 100644 --- a/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.cs +++ b/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.cs @@ -1,4 +1,5 @@ using TMPro; +using UnityEngine; using UnityEngine.UI; public class WaveRewardCard : CardBase @@ -6,6 +7,7 @@ public class WaveRewardCard : CardBase public TextMeshProUGUI[] texts; // 0 점수 public Slider slider_score; public ObtainItemCard rewardCard; + public GameObject[] gos; // 0 받기 버튼 WaveRewardListTableData m_Data; ItemSimpleData RewardData = new ItemSimpleData(); @@ -16,16 +18,37 @@ public class WaveRewardCard : CardBase m_Data = _base as WaveRewardListTableData; var sdata = ServerInfo.Ins.m_ServerData; var rewardindex = sdata.Get_DungeonValue(eDungeon.d4_Wave, 3); + var point = sdata.Get_DungeonValue(eDungeon.d4_Wave, 2); + var beforePoint = table_waverewardlist.Ins.Get_BeforeScore(m_Data.n_Index); + + gos[0].SetActive(CanGetReward()); texts[0].text = m_Data.n_Score.ToString(); - if (rewardindex > m_Data.n_Index) - slider_score.value = 1f; - else if (rewardindex + 1 == m_Data.n_Index) - slider_score.value = (float)sdata.Get_DungeonValue(eDungeon.d4_Wave, 2) / m_Data.n_Score; - else - slider_score.value = 0f; + slider_score.value = (float)(point - beforePoint) / (m_Data.n_Score - beforePoint); RewardData.itemid = m_Data.n_RewardID; RewardData.amount = m_Data.n_RewardAmount; rewardCard.Set(RewardData); } + + bool CanGetReward() + { + var sdata = ServerInfo.Ins.m_ServerData; + var rewardindex = sdata.Get_DungeonValue(eDungeon.d4_Wave, 3); + if (rewardindex + 1 == m_Data.n_Index) + return sdata.Get_DungeonValue(eDungeon.d4_Wave, 2) >= m_Data.n_Score; + return false; + } + + public void OnClick_Get() + { + if (CanGetReward()) + { + var sdata = ServerInfo.Ins.m_ServerData; + sdata.Set_DungeonValue(eDungeon.d4_Wave, 3, m_Data.n_Index); + sdata.Add_Item(m_Data.n_RewardID, m_Data.n_RewardAmount); + ObtainItemUI.Ins.Set(new ItemSimpleData { itemid = m_Data.n_RewardID, amount = m_Data.n_RewardAmount }); + WaveRewardUI.Ins.OnClick_Tab(); + MapChoiceUI_Dungeon_Wave.Ins.Set_Noti(); + } + } } \ No newline at end of file diff --git a/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.prefab b/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.prefab index 3c09e42b2..2ee13c318 100644 --- a/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.prefab +++ b/Assets/ResWork/UIPrefabs/Dungeon/WaveRewardCard.prefab @@ -121,6 +121,7 @@ RectTransform: - {fileID: 946319473914811832} - {fileID: 6067735948125108623} - {fileID: 7031247040158910881} + - {fileID: 5483354967819501389} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} @@ -144,6 +145,154 @@ MonoBehaviour: - {fileID: 7570830821060321738} slider_score: {fileID: 2133161692218889004} rewardCard: {fileID: 3655065086747597796} + gos: + - {fileID: 1980301193561188155} +--- !u!1 &1980301193561188155 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5483354967819501389} + - component: {fileID: 5364112118612793095} + - component: {fileID: 4577981031662008981} + - component: {fileID: 9168976729417449358} + - component: {fileID: 8341190525060949097} + m_Layer: 5 + m_Name: btn_get + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5483354967819501389 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1980301193561188155} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5529366468630449043} + m_Father: {fileID: 6984670186840170423} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -113.6, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5364112118612793095 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1980301193561188155} + m_CullTransparentMesh: 1 +--- !u!114 &4577981031662008981 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1980301193561188155} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 65f581562538e304cbbfe8ee3beab09c, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &9168976729417449358 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1980301193561188155} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4577981031662008981} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4954981416163671786} + m_TargetAssemblyTypeName: WaveRewardCard, Assembly-CSharp + m_MethodName: OnClick_Get + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &8341190525060949097 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1980301193561188155} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ab4e7dba3733e584abb76cd4fbc0e116, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &2488148387664214296 GameObject: m_ObjectHideFlags: 0 @@ -429,6 +578,155 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &4672144162913787463 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5529366468630449043} + - component: {fileID: 1539731413326699354} + - component: {fileID: 3046652204127618241} + - component: {fileID: 5316000516923845607} + m_Layer: 5 + m_Name: btnName + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5529366468630449043 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4672144162913787463} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5483354967819501389} + 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 &1539731413326699354 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4672144162913787463} + m_CullTransparentMesh: 1 +--- !u!114 &3046652204127618241 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4672144162913787463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\uBC1B\uAE30" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: a387e325271126742ad15569dba1ac57, type: 2} + m_sharedMaterial: {fileID: -6459762427321423278, guid: a387e325271126742ad15569dba1ac57, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 20 + m_fontSizeBase: 20 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 10 + m_fontSizeMax: 40 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 4096 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!114 &5316000516923845607 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4672144162913787463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c2aa95ff1b7adc044bd9372cf2958828, type: 3} + m_Name: + m_EditorClassIdentifier: + m_localtextKey: 295 --- !u!1 &6738235931601579188 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Script/Table/Dungeon/table_waverewardlist.cs b/Assets/Script/Table/Dungeon/table_waverewardlist.cs index ad0420faa..3a7c58441 100644 --- a/Assets/Script/Table/Dungeon/table_waverewardlist.cs +++ b/Assets/Script/Table/Dungeon/table_waverewardlist.cs @@ -46,6 +46,7 @@ public class table_waverewardlist : table_missionbase public static table_waverewardlist Ins; List tableDatas; Dictionary> dic_Datas = new Dictionary>(); + Dictionary dic_Data = new Dictionary(); public int MaxDiff; protected override void Awake() @@ -63,6 +64,7 @@ public class table_waverewardlist : table_missionbase if (!dic_Datas.ContainsKey(data.n_Difficult)) dic_Datas.Add(data.n_Difficult, new List()); dic_Datas[data.n_Difficult].Add(data); + dic_Data.Add(data.n_Index, data); } MaxDiff = tableDatas[tableDatas.Count - 1].n_Difficult; base.Start(); @@ -70,4 +72,9 @@ public class table_waverewardlist : table_missionbase public List Get_DataList() { return tableDatas; } public List Get_DataList(int diff) { return dic_Datas[diff]; } + public int Get_BeforeScore(int index) + { + if (index == 1) return 0; + return dic_Data[index - 1].n_Score; + } } \ No newline at end of file diff --git a/Assets/Script/UI/Dungeon/WaveRewardUI.cs b/Assets/Script/UI/Dungeon/WaveRewardUI.cs index ca4a42955..47321c283 100644 --- a/Assets/Script/UI/Dungeon/WaveRewardUI.cs +++ b/Assets/Script/UI/Dungeon/WaveRewardUI.cs @@ -2,12 +2,15 @@ using System.Collections.Generic; public class WaveRewardUI : uScrollViewMgr { + public static WaveRewardUI Ins; + public TabUIBase m_Tab; List list_tabData = new List(); public override void Set() { + Ins = this; if (list_tabData.Count == 0) for (int i = 0; i < table_waverewardlist.Ins.MaxDiff; i++) list_tabData.Add(new TabUIData { btnName = (i + 1).ToString(), onClick = OnClick_Tab }); @@ -17,7 +20,7 @@ public class WaveRewardUI : uScrollViewMgr OnClick_Tab(); } - private void OnClick_Tab() + public void OnClick_Tab() { Set_ScrollView(table_waverewardlist.Ins.Get_DataList(m_Tab.Get_Index() + 1)); } diff --git a/Assets/Script/UI/Map/MapChoiceUI_Dungeon.cs b/Assets/Script/UI/Map/MapChoiceUI_Dungeon.cs index 5bff31eb5..e8b3ae2b3 100644 --- a/Assets/Script/UI/Map/MapChoiceUI_Dungeon.cs +++ b/Assets/Script/UI/Map/MapChoiceUI_Dungeon.cs @@ -1,4 +1,3 @@ -using CodeStage.AntiCheat.ObscuredTypes; using System.Collections.Generic; using TMPro; diff --git a/Assets/Script/UI/Map/MapChoiceUI_Dungeon_Wave.cs b/Assets/Script/UI/Map/MapChoiceUI_Dungeon_Wave.cs index 1a9c0634b..b7f84a3ea 100644 --- a/Assets/Script/UI/Map/MapChoiceUI_Dungeon_Wave.cs +++ b/Assets/Script/UI/Map/MapChoiceUI_Dungeon_Wave.cs @@ -3,17 +3,26 @@ using UnityEngine; public class MapChoiceUI_Dungeon_Wave : MapChoiceUI_DungeonBase { + public static MapChoiceUI_Dungeon_Wave Ins; + public TextMeshProUGUI[] texts_wave; // 0 웨이브 난이도, 1 웨이브 최고 점수 public WaveRewardUI m_WaveRewardUI; // 웨이브 보상 정보 public GameObject go_WaveRewardNoti; public override void Set() { + Ins = this; base.Set(); var sdata = ServerInfo.Ins.m_ServerData; texts_wave[0].text = "";// DSUtil.Format(334, MyValue.MyChoiceMapData.n_Difficult); texts_wave[1].text = DSUtil.Format(335, sdata.Get_DungeonValue(eDungeon.d4_Wave, 2)); + Set_Noti(); + } + + public void Set_Noti() + { + var sdata = ServerInfo.Ins.m_ServerData; go_WaveRewardNoti.SetActive(sdata.CanGetWaveReward()); }