[Style] 승급,강등 포인트효과

휘릭 돌면서 초기화됩니다.
This commit is contained in:
HaeinLEE 2025-03-28 17:15:09 +09:00
parent c049b4fbf6
commit aa943476db
2 changed files with 42 additions and 6 deletions

View File

@ -121,10 +121,13 @@ public class RatingPointsController : MonoBehaviour
private void SetScoreCountText() private void SetScoreCountText()
{ {
// 남은 승리수가 0인 경우 승급점수 도달 혹은 강등점수 도달 // 남은 승리수가 0인 경우 승급점수 도달 혹은 강등점수 도달
if (_newRequiredScore == 0 || _newRequiredScore == _oldRequiredScore * 2) if (_newRequiredScore == 0)
{ {
//새로운 급수에 맞춰서 패널 초기화하기 scoreCountText.text = "승급 포인트에 달성했습니다 !";
scoreCountText.text = ""; }
else if (_newRequiredScore == _oldRequiredScore * 2)
{
scoreCountText.text = "점수가 낮아 강등됩니다..";
} }
else if (_newRequiredScore < 0) else if (_newRequiredScore < 0)
{ {
@ -145,8 +148,8 @@ public class RatingPointsController : MonoBehaviour
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
plusImage[i].GetComponent<Image>().color = _plusColor; plusImage[i].GetComponent<Image>().color = _plusColor;
scoreCountText.text = $"더 이상 승급 할 수 없습니다.\n누적 {winCount} 승 하셨습니다.";
} }
scoreCountText.text = $"더 이상 승급 할 수 없습니다.\n누적 {winCount} 승 하셨습니다.";
} }
public void SetRatingDownLimit(int loseCount) public void SetRatingDownLimit(int loseCount)
@ -154,9 +157,35 @@ public class RatingPointsController : MonoBehaviour
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
minusImages[i].GetComponent<Image>().color = _minusColor; minusImages[i].GetComponent<Image>().color = _minusColor;
scoreCountText.text = $"더 이상 강등 될 수 없습니다.\n누적 {loseCount*-1} 패 하셨습니다.";
} }
scoreCountText.text = $"더 이상 강등 될 수 없습니다.\n누적 {loseCount*-1} 패 하셨습니다.";
} }
//승급, 강등시 패널을 초기화해서 띄워주는 함수 추가 //승급, 강등시 패널을 초기화해서 띄워주는 함수 추가
public void InitRatingUpPoints()
{
StartCoroutine(RatingUpPoints());
}
private IEnumerator RatingUpPoints()
{
foreach (var plusPoint in plusImage)
{
ChangeImageColor(plusPoint, _defaultColor);
yield return new WaitForSeconds(0.2f);
}
}
public void InitRatingDownPoints()
{
StartCoroutine(RatingDownPoints());
}
private IEnumerator RatingDownPoints()
{
for (int i = minusImages.Length; i >0; i--)
{
ChangeImageColor(minusImages[i-1], _defaultColor);
yield return new WaitForSeconds(0.2f);
}
}
} }

View File

@ -58,6 +58,10 @@ public class RatingPanelController : PanelController
if (scoreResultInfo.isAdvancement == 1) if (scoreResultInfo.isAdvancement == 1)
{ {
GameManager.Instance.panelManager.OpenRatingEffectPanel(1); GameManager.Instance.panelManager.OpenRatingEffectPanel(1);
//패널의 포인트들 초기화
_ratingPointsController.InitRatingUpPoints();
//TODO: 승급이 10->9 그리고 5->4일 때 패널 바꿔주기
} }
},() => { }); },() => { });
break; break;
@ -69,6 +73,9 @@ public class RatingPanelController : PanelController
if (scoreResultInfo.isAdvancement == -1) if (scoreResultInfo.isAdvancement == -1)
{ {
GameManager.Instance.panelManager.OpenRatingEffectPanel(-1); GameManager.Instance.panelManager.OpenRatingEffectPanel(-1);
_ratingPointsController.InitRatingDownPoints();
//TODO: 강등이 4->5 그리고 9->10일 때 패널 바꿔주기
} }
}, () => { }); }, () => { });
break; break;
@ -161,6 +168,6 @@ public class RatingPanelController : PanelController
getPointsText.text = $"게임에서 {win}했습니다.\n{Constants.RAING_POINTS} 승급 포인트를 {get}"; getPointsText.text = $"게임에서 {win}했습니다.\n{Constants.RAING_POINTS} 승급 포인트를 {get}";
} }
// 애니메이션 실행 완료를 위한 wait // 애니메이션 실행 완료를 위한 wait
yield return new WaitForSecondsRealtime(1.5f); yield return new WaitForSecondsRealtime(1.8f);
} }
} }