Merge pull request #30 from Degulleo/DO-16-랭킹

Do 16 랭킹
This commit is contained in:
parkillhwan 2025-03-21 11:04:07 +09:00 committed by GitHub
commit df14a55784
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 93 additions and 114 deletions

View File

@ -38,4 +38,9 @@ public class MainPanelButtonController : MonoBehaviour
{ {
GameManager.Instance.panelManager.OpenReplayPanel(); GameManager.Instance.panelManager.OpenReplayPanel();
} }
//public void OpenRankingPanelClick()
//{
//GameManager.Instance.panelManager.OnRankingPanelClick();
//}
} }

View File

@ -12,8 +12,6 @@ GameObject:
- component: {fileID: 2911450618660204948} - component: {fileID: 2911450618660204948}
- component: {fileID: 2729261171078307673} - component: {fileID: 2729261171078307673}
- component: {fileID: 4465141290128179683} - component: {fileID: 4465141290128179683}
- component: {fileID: 2835505888941074797}
- component: {fileID: 5687316735128766768}
m_Layer: 5 m_Layer: 5
m_Name: Viewport m_Name: Viewport
m_TagString: Untagged m_TagString: Untagged
@ -37,7 +35,7 @@ RectTransform:
m_Father: {fileID: 1188344226235047902} m_Father: {fileID: 1188344226235047902}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
@ -92,46 +90,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_ShowMaskGraphic: 1 m_ShowMaskGraphic: 1
--- !u!114 &2835505888941074797
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1858212639388121281}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 1
m_VerticalFit: 2
--- !u!114 &5687316735128766768
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1858212639388121281}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 5
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &2602607401298266001 --- !u!1 &2602607401298266001
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -168,7 +126,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 40, y: -40} m_AnchoredPosition: {x: 40, y: -40}
m_SizeDelta: {x: 36, y: 40} m_SizeDelta: {x: 73, y: 72}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6169341149558268219 --- !u!222 &6169341149558268219
CanvasRenderer: CanvasRenderer:
@ -198,7 +156,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 427761ad91f2d9d4e85af2f6a2894218, type: 3} m_Sprite: {fileID: 21300000, guid: 2f19224efc36c9b49978cafd03ede1bb, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 0
m_FillCenter: 1 m_FillCenter: 1
@ -252,7 +210,7 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 0} - m_Target: {fileID: 1589736077307570888}
m_TargetAssemblyTypeName: LeaderBoardController, Assembly-CSharp m_TargetAssemblyTypeName: LeaderBoardController, Assembly-CSharp
m_MethodName: OnBackButtonClicked m_MethodName: OnBackButtonClicked
m_Mode: 1 m_Mode: 1
@ -301,8 +259,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -212} m_AnchoredPosition: {x: 0, y: -112.84912}
m_SizeDelta: {x: 1080, y: 1496} m_SizeDelta: {x: 1080, y: 1694.3018}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &824343901473742242 --- !u!222 &824343901473742242
CanvasRenderer: CanvasRenderer:
@ -361,14 +319,14 @@ MonoBehaviour:
m_Elasticity: 0.1 m_Elasticity: 0.1
m_Inertia: 1 m_Inertia: 1
m_DecelerationRate: 0.135 m_DecelerationRate: 0.135
m_ScrollSensitivity: 1 m_ScrollSensitivity: 100
m_Viewport: {fileID: 8740302936727227434} m_Viewport: {fileID: 8740302936727227434}
m_HorizontalScrollbar: {fileID: 0} m_HorizontalScrollbar: {fileID: 0}
m_VerticalScrollbar: {fileID: 3478506922544614059} m_VerticalScrollbar: {fileID: 3478506922544614059}
m_HorizontalScrollbarVisibility: 2 m_HorizontalScrollbarVisibility: 2
m_VerticalScrollbarVisibility: 2 m_VerticalScrollbarVisibility: 2
m_HorizontalScrollbarSpacing: -3 m_HorizontalScrollbarSpacing: -3
m_VerticalScrollbarSpacing: -3 m_VerticalScrollbarSpacing: -15
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -523,6 +481,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 227489081374553986} - component: {fileID: 227489081374553986}
- component: {fileID: 6416582684501908282} - component: {fileID: 6416582684501908282}
- component: {fileID: 2816695216852066709}
m_Layer: 5 m_Layer: 5
m_Name: Content m_Name: Content
m_TagString: Untagged m_TagString: Untagged
@ -544,10 +503,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 8740302936727227434} m_Father: {fileID: 8740302936727227434}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0.000034332275}
m_SizeDelta: {x: 1060, y: 1493.8} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!114 &6416582684501908282 --- !u!114 &6416582684501908282
MonoBehaviour: MonoBehaviour:
@ -562,7 +521,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Padding: m_Padding:
m_Left: 0 m_Left: 100
m_Right: 0 m_Right: 0
m_Top: 0 m_Top: 0
m_Bottom: 0 m_Bottom: 0
@ -570,11 +529,25 @@ MonoBehaviour:
m_Spacing: 50 m_Spacing: 50
m_ChildForceExpandWidth: 1 m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1 m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1 m_ChildControlWidth: 0
m_ChildControlHeight: 1 m_ChildControlHeight: 0
m_ChildScaleWidth: 0 m_ChildScaleWidth: 0
m_ChildScaleHeight: 0 m_ChildScaleHeight: 0
m_ReverseArrangement: 0 m_ReverseArrangement: 0
--- !u!114 &2816695216852066709
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3568653418969612126}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 1
m_VerticalFit: 2
--- !u!1 &4202334049855500581 --- !u!1 &4202334049855500581
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -633,7 +606,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 0, b: 0, a: 1} m_Color: {r: 1, g: 0.2847969, b: 0, a: 1}
m_RaycastTarget: 1 m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1 m_Maskable: 1
@ -659,9 +632,9 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 2084150948806744478} - component: {fileID: 2084150948806744478}
- component: {fileID: 7465938882283913230}
- component: {fileID: 1080045383039686757}
- component: {fileID: 3478506922544614059} - component: {fileID: 3478506922544614059}
- component: {fileID: 6301460630123320729}
- component: {fileID: 1849839432792571899}
m_Layer: 5 m_Layer: 5
m_Name: Scrollbar Vertical m_Name: Scrollbar Vertical
m_TagString: Untagged m_TagString: Untagged
@ -687,46 +660,8 @@ RectTransform:
m_AnchorMin: {x: 1, y: 0} m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: -17} m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 1, y: 1} m_Pivot: {x: 1, y: 1}
--- !u!222 &7465938882283913230
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5452094549188284008}
m_CullTransparentMesh: 1
--- !u!114 &1080045383039686757
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5452094549188284008}
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: 0, b: 0, 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: 0}
m_Type: 1
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 &3478506922544614059 --- !u!114 &3478506922544614059
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -748,10 +683,10 @@ MonoBehaviour:
m_SelectOnRight: {fileID: 0} m_SelectOnRight: {fileID: 0}
m_Transition: 1 m_Transition: 1
m_Colors: m_Colors:
m_NormalColor: {r: 1, g: 0.55039775, b: 0, a: 1} m_NormalColor: {r: 1, g: 0.28627452, b: 0, a: 1}
m_HighlightedColor: {r: 1, g: 0, b: 0, a: 1} m_HighlightedColor: {r: 1, g: 0, b: 0, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} m_PressedColor: {r: 0.93710685, g: 0.33299702, b: 0.33299702, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_SelectedColor: {r: 0.8409424, g: 0.9685534, b: 0.57564956, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1 m_ColorMultiplier: 1
m_FadeDuration: 0.1 m_FadeDuration: 0.1
@ -776,6 +711,44 @@ MonoBehaviour:
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
--- !u!222 &6301460630123320729
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5452094549188284008}
m_CullTransparentMesh: 1
--- !u!114 &1849839432792571899
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5452094549188284008}
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: 0.59607846}
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: 0}
m_Type: 1
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!1 &6747908716986530392 --- !u!1 &6747908716986530392
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -810,7 +783,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: -20} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7787380462476439032 --- !u!1 &7787380462476439032
GameObject: GameObject:
@ -882,7 +855,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -300} m_AnchoredPosition: {x: 0, y: -115}
m_SizeDelta: {x: 0, y: 50} m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 1}
--- !u!222 &5432856254510042803 --- !u!222 &5432856254510042803

View File

@ -545,7 +545,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0} m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -392, y: -2.9951172} m_AnchoredPosition: {x: -392, y: -0.0053710938}
m_SizeDelta: {x: 784, y: 0} m_SizeDelta: {x: 784, y: 0}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!114 &5526954107552917871 --- !u!114 &5526954107552917871

View File

@ -1166,7 +1166,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1060, y: 170} m_SizeDelta: {x: 900, y: 170}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8547166501184847619 --- !u!114 &8547166501184847619
MonoBehaviour: MonoBehaviour:
@ -1185,7 +1185,7 @@ MonoBehaviour:
m_Right: 0 m_Right: 0
m_Top: 30 m_Top: 30
m_Bottom: 35 m_Bottom: 35
m_ChildAlignment: 0 m_ChildAlignment: 3
m_Spacing: 0 m_Spacing: 0
m_ChildForceExpandWidth: 1 m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1 m_ChildForceExpandHeight: 1

View File

@ -23,9 +23,9 @@ public class ScoreCellController : MonoBehaviour
winText.text = item.win.ToString(); winText.text = item.win.ToString();
loseText.text = item.lose.ToString(); loseText.text = item.lose.ToString();
if (profileImage != null && item.profileImageIndex != null) if (profileImage != null && item.imageIndex != null)
{ {
profileImage.sprite = profileSprites[item.profileImageIndex]; // 프로필 이미지 (Sprite 할당) profileImage.sprite = profileSprites[item.imageIndex]; // 프로필 이미지 (Sprite 할당)
} }
} }
} }

View File

@ -2,9 +2,10 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
[Serializable] [Serializable]
public class ScoreListWrapper public class ScoreListWrapper
{ {
public List<ScoreInfo> scoreInfos; // 여러 개의 ScoreInfo를 담을 리스트 public List<ScoreInfo> leaderboardDatas; // 여러 개의 ScoreInfo를 담을 리스트
} }

View File

@ -29,7 +29,7 @@ public struct ScoreInfo
public int win; public int win;
public int lose; public int lose;
public int totalGames; public int totalGames;
public int profileImageIndex; public int imageIndex;
} }
[Serializable] [Serializable]

View File

@ -31,7 +31,7 @@ public class LeaderBoardController : MonoBehaviour
private IEnumerator GetLeaderboardData() private IEnumerator GetLeaderboardData()
{ {
string url = Constants.ServerURL + "/leaderboard"; // 서버의 리더보드 데이터 URL string url = Constants.ServerURL + "/leaderboard/"; // 서버의 리더보드 데이터 URL
UnityWebRequest www = UnityWebRequest.Get(url); // GET 요청으로 데이터 받기 UnityWebRequest www = UnityWebRequest.Get(url); // GET 요청으로 데이터 받기
yield return www.SendWebRequest(); // 요청 전송 대기 yield return www.SendWebRequest(); // 요청 전송 대기
@ -48,7 +48,7 @@ public class LeaderBoardController : MonoBehaviour
// JSON을 ScoreInfo 리스트로 파싱 // JSON을 ScoreInfo 리스트로 파싱
ScoreListWrapper wrapper = JsonUtility.FromJson<ScoreListWrapper>(jsonResponse); ScoreListWrapper wrapper = JsonUtility.FromJson<ScoreListWrapper>(jsonResponse);
List<ScoreInfo> leaderboardItems = wrapper.scoreInfos; List<ScoreInfo> leaderboardItems = wrapper.leaderboardDatas;
// Show 메서드를 통해 데이터를 표시 // Show 메서드를 통해 데이터를 표시
Show(leaderboardItems); Show(leaderboardItems);
@ -106,7 +106,7 @@ public class LeaderBoardController : MonoBehaviour
if (!string.IsNullOrEmpty(savedData)) if (!string.IsNullOrEmpty(savedData))
{ {
// 저장된 JSON 데이터를 파싱하여 리더보드 리스트로 변환 // 저장된 JSON 데이터를 파싱하여 리더보드 리스트로 변환
leaderboard = JsonUtility.FromJson<ScoreListWrapper>(savedData).scoreInfos; leaderboard = JsonUtility.FromJson<ScoreListWrapper>(savedData).leaderboardDatas;
} }
return leaderboard; return leaderboard;