[Comment] TODO 수정과 주석 추가

This commit is contained in:
HaeinLEE 2025-03-27 15:32:57 +09:00
parent e3f82dc983
commit 1821503f16
4 changed files with 12 additions and 59 deletions

View File

@ -45,8 +45,6 @@ public class MainPanelManager : MonoBehaviour
// GameManager.Instance.panelManager.OpenConfirmPanel(userInfo.nickname + "님" + "\n" + "자동 로그인 되었습니다", () => { }); // GameManager.Instance.panelManager.OpenConfirmPanel(userInfo.nickname + "님" + "\n" + "자동 로그인 되었습니다", () => { });
loadingPanelController.StopLoading(); loadingPanelController.StopLoading();
//TODO: 테스트용 승급패널 오픈
GameManager.Instance.panelManager.OpenRatingPanel(Enums.GameResult.Win);
}, () => }, () =>
{ {
Debug.Log("자동 로그인 실패"); Debug.Log("자동 로그인 실패");

View File

@ -76,7 +76,6 @@ public class ReplayController : MonoBehaviour
public void InitReplayUI() public void InitReplayUI()
{ {
//유저 닉네임 설정 //유저 닉네임 설정
//TODO: 유니티 에디터에서 폰트 설정바꾸기
playerANicknameText.text = ReplayManager.Instance.GetPlayerANickname(); playerANicknameText.text = ReplayManager.Instance.GetPlayerANickname();
playerBNicknameText.text = ReplayManager.Instance.GetPlayerBNickname(); playerBNicknameText.text = ReplayManager.Instance.GetPlayerBNickname();

View File

@ -22,7 +22,6 @@ public class RatingPointsController : MonoBehaviour
public void InitRatingPoints(int oldScore,Enums.GameResult gameResult, int defaultRequiredScore) public void InitRatingPoints(int oldScore,Enums.GameResult gameResult, int defaultRequiredScore)
{ {
// TODO: [인덱스계산 ㅇㅖ외처리 ] 계산한 값 절대값이 defaultRequiredScore보다 큰 경우 return. 근데 이런 값이 나온다는게 이미 계산 오류가 어디서 생긴 것이겠죠..? // TODO: [인덱스계산 ㅇㅖ외처리 ] 계산한 값 절대값이 defaultRequiredScore보다 큰 경우 return. 근데 이런 값이 나온다는게 이미 계산 오류가 어디서 생긴 것이겠죠..?
// 그런건 아니고 18급에서 강등 안됨 1급에서 승급 안됨 계산을 해야되네예.... 근데 이건 rating panel controller에서 걸러서 보내면 될듯.!
_oldScore = oldScore; _oldScore = oldScore;
Sequence sequence = DOTween.Sequence(); Sequence sequence = DOTween.Sequence();
if (_oldScore == 0) if (_oldScore == 0)
@ -126,10 +125,15 @@ public class RatingPointsController : MonoBehaviour
SetScoreCountText(_newRequiredScore,defaultRequiredScore); SetScoreCountText(_newRequiredScore,defaultRequiredScore);
} }
/// <summary>
/// 승급까지 남은 승수 계산
/// </summary>
/// <param name="scoreCount">새로 업데이트 된 승급까지 필요한 승 수</param>
/// <param name="defaultRequiredScore">해당 급수에서 0에서 승급까지 필요한 승수</param>
private void SetScoreCountText(int scoreCount,int defaultRequiredScore) private void SetScoreCountText(int scoreCount,int defaultRequiredScore)
{ {
// 남은 승리수가 0인 경우 승급 // 남은 승리수가 0인 경우 승급점수 도달 혹은 강등점수 도달
if (scoreCount == 0) if (scoreCount == 0 || scoreCount == defaultRequiredScore * 2)
{ {
scoreCountText.text = ""; scoreCountText.text = "";
} }
@ -137,7 +141,7 @@ public class RatingPointsController : MonoBehaviour
{ {
scoreCountText.text = "더 이상 승급 할 수 없습니다."; scoreCountText.text = "더 이상 승급 할 수 없습니다.";
} }
else if (scoreCount >= defaultRequiredScore * 2) else if (scoreCount > defaultRequiredScore * 2)
{ {
scoreCountText.text = "더이상 강등 될 수 없습니다."; scoreCountText.text = "더이상 강등 될 수 없습니다.";
} }

View File

@ -22,7 +22,7 @@ public class RatingPanelController : PanelController
{ {
Hide(); Hide();
} }
//TODO: 미사용시 삭제
public void OnClickRetryButton() public void OnClickRetryButton()
{ {
Hide(() => { }); Hide(() => { });
@ -44,6 +44,8 @@ public class RatingPanelController : PanelController
yield return InitRatingPanel(gameResult); yield return InitRatingPanel(gameResult);
//유저 인포 업데이트와 승급 이펙트 띄우기 //유저 인포 업데이트와 승급 이펙트 띄우기
// TODO: 서버 업데이트를 승급패널보다 더 큰 로직에서 처리하는 것이 좋을 것 같습니다.
// 리팩토링 시 반영 부탁드립니다.
switch (gameResult) switch (gameResult)
{ {
case (Enums.GameResult.Win): case (Enums.GameResult.Win):
@ -113,7 +115,6 @@ public class RatingPanelController : PanelController
{ {
_oldScore = userInfo.score; _oldScore = userInfo.score;
// 1급이고 이미 10승 이상인 경우 // 1급이고 이미 10승 이상인 경우
//TODO: IF문 줄일 수 있을 것 같은데 머리가 안돕니다. ..
if (_myRating == 1 && userInfo.score >= 10 ) if (_myRating == 1 && userInfo.score >= 10 )
{ {
// 10승에서 패배한 경우 점수 잃는 애니메이션 // 10승에서 패배한 경우 점수 잃는 애니메이션
@ -162,56 +163,7 @@ public class RatingPanelController : PanelController
{ {
getPointsText.text = $"게임에서 {win}했습니다.\n{Constants.RAING_POINTS} 승급 포인트를 {get}"; getPointsText.text = $"게임에서 {win}했습니다.\n{Constants.RAING_POINTS} 승급 포인트를 {get}";
} }
// 애니메이션 실행 완료를 위한 wait
yield return new WaitForSecondsRealtime(1.5f); yield return new WaitForSecondsRealtime(1.5f);
} }
// private IEnumerator RatingPointsAnimation(Enums.GameResult gameResult,int requiredScore)
// {
// // 게임 전 스코어로 초기화
// NetworkManager.Instance.GetInfo((userInfo) =>
// {
// _oldScore = userInfo.score;
// // 1급이고 이미 10승 이상인 경우
// //TODO: IF문 줄일 수 있을 것 같은데 머리가 안돕니다. ..
// if (_myRating == 1 && userInfo.score >= 10 )
// {
// // 10승에서 패배한 경우 점수 잃는 애니메이션
// if (gameResult == Enums.GameResult.Lose && userInfo.score == 10)
// {
// _ratingPointsController.InitRatingPoints(_oldScore,_gameResult,requiredScore);
// }
// else
// {
// if(gameResult == Enums.GameResult.Lose)
// _ratingPointsController.SetRatingUpLimit(_oldScore-1);
// else
// _ratingPointsController.SetRatingUpLimit(_oldScore+1);
// }
// }
// // 18급이고 이미 3패 이상인 경우
// else if (_myRating == 18 && userInfo.score <= -3)
// {
// //3승에서 승리한 경우 점수 얻는 애니메이션
// if (gameResult == Enums.GameResult.Win && userInfo.score == -3)
// {
// _ratingPointsController.InitRatingPoints(_oldScore,_gameResult,requiredScore);
// }
// else
// {
// if(gameResult == Enums.GameResult.Lose)
// _ratingPointsController.SetRatingDownLimit(_oldScore-1);
// else
// _ratingPointsController.SetRatingDownLimit(_oldScore+1);
// }
// }
// else
// {
// _ratingPointsController.InitRatingPoints(_oldScore,_gameResult,requiredScore);
//
// }
//
// }, () =>
// { });
// }
} }