DO-16 : 작업 중 백업
This commit is contained in:
parent
51b8b40041
commit
399685efb3
@ -506,6 +506,138 @@ SpriteRenderer:
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &2602607401298266001
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7490092893895923112}
|
||||
- component: {fileID: 6169341149558268219}
|
||||
- component: {fileID: 3721233377363418243}
|
||||
- component: {fileID: 5371985941544601491}
|
||||
m_Layer: 5
|
||||
m_Name: BackButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7490092893895923112
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2602607401298266001}
|
||||
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: 8762241190862130675}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 40, y: -40}
|
||||
m_SizeDelta: {x: 36, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6169341149558268219
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2602607401298266001}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3721233377363418243
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2602607401298266001}
|
||||
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: 427761ad91f2d9d4e85af2f6a2894218, 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 &5371985941544601491
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2602607401298266001}
|
||||
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: 3721233377363418243}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: -7954161860228604151}
|
||||
m_TargetAssemblyTypeName: LeaderBoardController, Assembly-CSharp
|
||||
m_MethodName: OnBackButtonClicked
|
||||
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!1 &2732566798401077114
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -834,6 +966,7 @@ RectTransform:
|
||||
- {fileID: 1077369489077175616}
|
||||
- {fileID: 2617138196515233625}
|
||||
- {fileID: 1188344226235047902}
|
||||
- {fileID: 7490092893895923112}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@ -863,6 +996,8 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
scoreCell: {fileID: 3568653418969612126}
|
||||
content: {fileID: 227489081374553986}
|
||||
signInPanel: {fileID: 925522282249935710, guid: e14c9b2925f0ddb4192af743e5cc166a, type: 3}
|
||||
leaderboardPanel: {fileID: 3181524094944658765}
|
||||
--- !u!1 &3442993592452086091
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -928,8 +1063,8 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_Sprite: {fileID: 21300000, guid: a99fa85777f9a5b4d86b859277707544, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
|
@ -8,13 +8,18 @@ public class LeaderBoardController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject scoreCell;
|
||||
[SerializeField] private Transform content;
|
||||
private List<ScoreCellController> scoreCC = new List<ScoreCellController>();
|
||||
[SerializeField] private GameObject signInPanel; // SignInPanel 참조 (같은 씬에서 사용할 경우)
|
||||
[SerializeField] private GameObject leaderboardPanel; // LeaderboardPanel 참조
|
||||
|
||||
private List<ScoreCellController> scoreCC = new List<ScoreCellController>(); // 점수 셀을 관리할 리스트
|
||||
|
||||
private void Start()
|
||||
{
|
||||
StartCoroutine(OnConnectedToServer());
|
||||
leaderboardPanel.SetActive(false); // 초기에는 리더보드 패널을 숨깁니다.
|
||||
StartCoroutine(OnConnectedToServer()); // 서버에서 리더보드 데이터를 받아옵니다.
|
||||
}
|
||||
|
||||
// 서버와 연결하여 데이터를 받아오는 함수
|
||||
private IEnumerator OnConnectedToServer()
|
||||
{
|
||||
string url = Constants.ServerURL + "/users/Leaderboard"; // 서버의 리더보드 데이터 URL
|
||||
@ -23,7 +28,7 @@ public class LeaderBoardController : MonoBehaviour
|
||||
yield return www.SendWebRequest(); // 요청 전송 대기
|
||||
|
||||
// 요청이 실패했을 때
|
||||
if (www.isNetworkError || www.isHttpError)
|
||||
if (www.result == UnityWebRequest.Result.ConnectionError || www.result == UnityWebRequest.Result.ProtocolError)
|
||||
{
|
||||
Debug.LogError("Error: " + www.error);
|
||||
}
|
||||
@ -35,18 +40,33 @@ public class LeaderBoardController : MonoBehaviour
|
||||
// JSON을 ScoreInfo 리스트로 파싱
|
||||
List<ScoreInfo> scoreInfos = JsonUtility.FromJson<ScoreListWrapper>(jsonResponse).scoreInfos;
|
||||
|
||||
// 받아온 데이터를 기반으로 점수 셀 생성
|
||||
foreach (var scoreInfo in scoreInfos)
|
||||
{
|
||||
CreateCell(scoreInfo); // 각 점수 정보를 기반으로 셀 생성
|
||||
}
|
||||
// 받아온 데이터를 기반으로 점수 셀을 생성하고 리스트를 갱신
|
||||
CreateCellsFromScoreInfos(scoreInfos);
|
||||
}
|
||||
}
|
||||
|
||||
// 받아온 ScoreInfo 리스트를 기반으로 셀을 생성하는 함수
|
||||
private void CreateCellsFromScoreInfos(List<ScoreInfo> scoreInfos)
|
||||
{
|
||||
// 기존의 셀들을 초기화 (필요시)
|
||||
foreach (Transform child in content)
|
||||
{
|
||||
Destroy(child.gameObject); // 기존 셀들을 삭제
|
||||
}
|
||||
|
||||
// 받은 점수 데이터 수에 맞춰 셀을 생성
|
||||
for (int i = 0; i < scoreInfos.Count; i++)
|
||||
{
|
||||
CreateCell(scoreInfos[i]); // 각 점수 정보를 기반으로 셀 생성
|
||||
}
|
||||
}
|
||||
|
||||
// 점수 정보를 기반으로 셀을 생성하는 함수
|
||||
public void CreateCell(ScoreInfo scoreInfo)
|
||||
{
|
||||
var scoreCellObj = Instantiate(scoreCell, content);
|
||||
var scoreCellObj = Instantiate(scoreCell, content); // 셀 객체 생성
|
||||
var scoreCellController = scoreCellObj.GetComponent<ScoreCellController>();
|
||||
|
||||
// 점수 셀 정보 설정
|
||||
if (scoreCellController != null)
|
||||
{
|
||||
@ -57,10 +77,19 @@ public class LeaderBoardController : MonoBehaviour
|
||||
Debug.LogError("ScoreCellController 컴포넌트가 점수 셀 프리팹에 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
// BackButton 클릭 시 호출되는 메소드
|
||||
public void OnBackButtonClicked()
|
||||
{
|
||||
// LeaderboardPanel을 숨기고 SignInPanel을 보이게 함
|
||||
leaderboardPanel.SetActive(false); // LeaderboardPanel 숨기기
|
||||
signInPanel.SetActive(true); // SignInPanel 보이기
|
||||
}
|
||||
}
|
||||
|
||||
// ScoreListWrapper 클래스를 정의 (리스트를 감싸는 클래스)
|
||||
[System.Serializable]
|
||||
public class ScoreListWrapper
|
||||
{
|
||||
public List<ScoreInfo> scoreInfos;
|
||||
public List<ScoreInfo> scoreInfos; // 점수 정보 리스트
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UserInfoResult
|
||||
{
|
||||
@ -11,6 +12,7 @@ public class UserInfoResult
|
||||
public int imageIndex;
|
||||
public int win;
|
||||
public int lose;
|
||||
public Image profileImage;
|
||||
}
|
||||
|
||||
public class UserManager : Singleton<UserManager>
|
||||
@ -23,6 +25,7 @@ public class UserManager : Singleton<UserManager>
|
||||
public int ImageIndex { get; private set; }
|
||||
public int Win { get; private set; }
|
||||
public int Lose { get; private set; }
|
||||
public Image profileImage { get; private set; }
|
||||
|
||||
protected override void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user