From 6c24679a86c17520f3618083f26ffad63c14c809 Mon Sep 17 00:00:00 2001 From: HaeinLEE Date: Wed, 26 Mar 2025 17:03:39 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=201=EA=B8=89=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=8A=B9=EA=B8=89=2018=EA=B8=89=EC=97=90=EC=84=9C=20=EA=B0=95?= =?UTF-8?q?=EB=93=B1=20=EC=95=88=EB=90=98=EB=8F=84=EB=A1=9D=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/Panels/Rating Panel.prefab | 13 +++++-------- .../RatingPointsController.cs | 18 +++++++++++++++--- .../PanelController/RatingPanelController.cs | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/Assets/Resources/Prefabs/Panels/Rating Panel.prefab b/Assets/Resources/Prefabs/Panels/Rating Panel.prefab index 457892e..2e6870a 100644 --- a/Assets/Resources/Prefabs/Panels/Rating Panel.prefab +++ b/Assets/Resources/Prefabs/Panels/Rating Panel.prefab @@ -87,7 +87,6 @@ MonoBehaviour: - {fileID: 1311169503289408066} - {fileID: 5188264888519248091} scoreCountText: {fileID: 4486315542052576465} - flipDuration: 0.3 --- !u!1 &399295670844813370 GameObject: m_ObjectHideFlags: 0 @@ -781,7 +780,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 0, y: 400} + m_AnchoredPosition: {x: 0, y: 200} m_SizeDelta: {x: 0, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &455442743415087100 @@ -1765,7 +1764,7 @@ RectTransform: 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: 800, y: 1200} + m_SizeDelta: {x: 800, y: 800} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &772580229406383796 CanvasRenderer: @@ -2976,7 +2975,6 @@ MonoBehaviour: - {fileID: 4800275766018260633} - {fileID: 655595974784322956} scoreCountText: {fileID: 2034389357604911762} - flipDuration: 0.3 --- !u!1 &4736016417537921913 GameObject: m_ObjectHideFlags: 0 @@ -3744,7 +3742,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\uAC8C\uC784\uC744 \uC2B9\uB9AC\uD558\uBA74 \uC2B9\uAE09\uD569\uB2C8\uB2E4." + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} @@ -4462,7 +4460,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\uAC8C\uC784\uC744 \uC2B9\uB9AC\uD558\uBA74 \uC2B9\uAE09\uD569\uB2C8\uB2E4." + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} @@ -5448,7 +5446,6 @@ MonoBehaviour: - {fileID: 5057135233660996524} - {fileID: 6043901390456812144} scoreCountText: {fileID: 9191314634354848581} - flipDuration: 0.3 --- !u!1 &9028279215159010714 GameObject: m_ObjectHideFlags: 0 @@ -5589,7 +5586,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\uAC8C\uC784\uC744 \uC2B9\uB9AC\uD558\uBA74 \uC2B9\uAE09\uD569\uB2C8\uB2E4." + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} diff --git a/Assets/Script/UI/PanelChildController/RatingPointsController.cs b/Assets/Script/UI/PanelChildController/RatingPointsController.cs index 3b5a8e3..6b038e1 100644 --- a/Assets/Script/UI/PanelChildController/RatingPointsController.cs +++ b/Assets/Script/UI/PanelChildController/RatingPointsController.cs @@ -22,6 +22,7 @@ public class RatingPointsController : MonoBehaviour public void InitRatingPoints(int oldScore,Enums.GameResult gameResult, int defaultRequiredScore) { // TODO: [인덱스계산 ㅇㅖ외처리 ] 계산한 값 절대값이 defaultRequiredScore보다 큰 경우 return. 근데 이런 값이 나온다는게 이미 계산 오류가 어디서 생긴 것이겠죠..? + // 그런건 아니고 18급에서 강등 안됨 1급에서 승급 안됨 계산을 해야되네예.... 근데 이건 rating panel controller에서 걸러서 보내면 될듯.! _oldScore = oldScore; Sequence sequence = DOTween.Sequence(); if (_oldScore == 0) @@ -117,7 +118,6 @@ public class RatingPointsController : MonoBehaviour } } - //TODO: 무승부인 경우 남은 승리 수 계산 if (gameResult == Enums.GameResult.Draw) { _newRequiredScore = defaultRequiredScore-oldScore; @@ -128,11 +128,23 @@ public class RatingPointsController : MonoBehaviour private void SetScoreCountText(int scoreCount,int defaultRequiredScore) { - if (scoreCount == 0 || scoreCount >= defaultRequiredScore * 2) + // 남은 승리수가 0인 경우 승급 + if (scoreCount == 0) + { scoreCountText.text = ""; + } + else if (scoreCount < 0) + { + scoreCountText.text = "더 이상 승급 할 수 없습니다."; + } + else if (scoreCount >= defaultRequiredScore * 2) + { + scoreCountText.text = "더이상 강등 될 수 없습니다."; + } else + { scoreCountText.text = $"{scoreCount} 게임을 승리하면 승급하게 됩니다."; - //강등되는 경우에도 텍스트 처리 + } } //승급, 강등시 패널을 초기화해서 띄워주는 함수 추가 diff --git a/Assets/Script/UI/PanelController/RatingPanelController.cs b/Assets/Script/UI/PanelController/RatingPanelController.cs index 53695cd..c382cc7 100644 --- a/Assets/Script/UI/PanelController/RatingPanelController.cs +++ b/Assets/Script/UI/PanelController/RatingPanelController.cs @@ -70,7 +70,20 @@ public class RatingPanelController : PanelController NetworkManager.Instance.GetInfo((userInfo) => { _oldScore = userInfo.score; - _ratingPointsController.InitRatingPoints(_oldScore,_gameResult,requiredScore); + // TODO: oldscore가 더이상 강등될 수 없는 상태, 더이상 승급할 수 없는 상태임을 체크해서 더이상 ~할 수 없습니다. 처리하기 + if (_myRating == 1 && userInfo.score >= requiredScore ) + { + + } + else if (_myRating == 18 && userInfo.score <= requiredScore*2) + { + + } + else + { + _ratingPointsController.InitRatingPoints(_oldScore,_gameResult,requiredScore); + + } }, () => { });