From c434d1a277af591169e30ef47dd516ccc659f35f Mon Sep 17 00:00:00 2001 From: HaeinLEE Date: Wed, 26 Mar 2025 13:45:50 +0900 Subject: [PATCH] =?UTF-8?q?[Style]=20=EC=8A=B9=ED=8C=A8=20=EC=97=AC?= =?UTF-8?q?=EB=B6=80=20enum=EC=9C=BC=EB=A1=9C=20=EC=A0=84=EB=8B=AC.=20?= =?UTF-8?q?=ED=8C=A8=EB=84=90=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20sho?= =?UTF-8?q?w=20=EC=9E=AC=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RatingPointsController.cs | 12 +++++-- .../Script/UI/PanelController/PanelManager.cs | 4 +-- .../PanelController/RatingPanelController.cs | 35 +++++++++++++------ 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/Assets/Script/UI/PanelChildController/RatingPointsController.cs b/Assets/Script/UI/PanelChildController/RatingPointsController.cs index 2be5fdd..d5bc1f0 100644 --- a/Assets/Script/UI/PanelChildController/RatingPointsController.cs +++ b/Assets/Script/UI/PanelChildController/RatingPointsController.cs @@ -10,7 +10,7 @@ public class RatingPointsController : MonoBehaviour [SerializeField] GameObject[] minusImages; [SerializeField] GameObject[] plusImage; [SerializeField] TMP_Text scoreCountText; - [SerializeField] private float flipDuration = 0.3f; + [SerializeField] private float flipDuration = 1f; private Color32 _minusColor = new Color32(255, 0, 0, 255); private Color32 _plusColor = new Color32(34, 87, 255, 255); @@ -30,14 +30,22 @@ public class RatingPointsController : MonoBehaviour for (int i = 0; i < oldScore; i++) { plusImage[i].GetComponent().color = _plusColor; + plusImage[i].GetComponent().DOFlip(); } } else if (oldScore < 0) { for (int i = oldScore; i < 0; i++) { - minusImages[minusImages.Length+i].GetComponent().color = _minusColor; + minusImages[minusImages.Length+i].GetComponent().DOColor(_minusColor, flipDuration); + plusImage[minusImages.Length+i].GetComponent().DOFlip(); } } } + + public int CalculateNewRequiredScore(bool isWin) + { + return 0; + } + } diff --git a/Assets/Script/UI/PanelController/PanelManager.cs b/Assets/Script/UI/PanelController/PanelManager.cs index cdda752..303f74a 100644 --- a/Assets/Script/UI/PanelController/PanelManager.cs +++ b/Assets/Script/UI/PanelController/PanelManager.cs @@ -189,12 +189,12 @@ public class PanelManager : MonoBehaviour } //승급 패널 생성 - public void OpenRatingPanel() + public void OpenRatingPanel(Enums.GameResult gameResult) { if (_canvas != null) { var replayPanelObject = GetPanel("Rating Panel"); - replayPanelObject.GetComponent().Show(); + replayPanelObject.GetComponent().Show(gameResult); } } diff --git a/Assets/Script/UI/PanelController/RatingPanelController.cs b/Assets/Script/UI/PanelController/RatingPanelController.cs index a8d2742..e77cf22 100644 --- a/Assets/Script/UI/PanelController/RatingPanelController.cs +++ b/Assets/Script/UI/PanelController/RatingPanelController.cs @@ -5,26 +5,43 @@ using UnityEngine; using UnityEngine.Serialization; using UnityEngine.UI; -public class RatingPanelController : ConfirmPanelController +public class RatingPanelController : PanelController { [SerializeField] private TMP_Text getPointsText; [SerializeField] private GameObject threePointsIndicatorGameObject; [SerializeField] private GameObject fivePointsIndicatorGameObject; [SerializeField] private GameObject tenPointsIndicatorGameObject; - private bool _isWin; + private Enums.GameResult _gameResult; private int _oldScore; private int _newScore; private int _myRating; private RatingPointsController _ratingPointsController; + + public void Show(Enums.GameResult gameResult) + { + InitRatingPanel(gameResult); + base.Show(); + } + + public void OnClickConfirmButton() + { + Hide(); + } + + public void OnClickRetryButton() + { + Hide(() => { }); + } + /// /// 텍스트 초기화, 승급포인트 계산 /// /// - public void InitRatingPanel(bool isWin) + public void InitRatingPanel(Enums.GameResult gameResult) { - _isWin = isWin; + _gameResult = gameResult; _myRating= UserManager.Instance.Rating; int requiredScore = 0; if (_myRating >= 10 && _myRating <= 18) // 10~18급은 3점 필요 @@ -47,8 +64,8 @@ public class RatingPanelController : ConfirmPanelController _ratingPointsController = tenPointsIndicatorGameObject.GetComponent(); } - string win = _isWin ? "승리" : "패배"; - string get = _isWin ? "얻었습니다." : "잃었습니다."; + string win = _gameResult == Enums.GameResult.Win ? "승리" : "패배"; + string get = _gameResult == Enums.GameResult.Win ? "얻었습니다." : "잃었습니다."; getPointsText.text = $"게임에서 {win}했습니다.\n{Constants.RAING_POINTS} 승급 포인트를 {get}"; @@ -60,10 +77,6 @@ public class RatingPanelController : ConfirmPanelController }, () => { }); } - - void Start() - { - InitRatingPanel(false); - } + }