[Feat] 1급에서 더이상 승급 안되게, 18급에서 강등 안되게 구현 완료. 테스트코드 있습니다.
This commit is contained in:
parent
6c24679a86
commit
78cb2356d7
@ -1104,7 +1104,7 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_text: "18\uAE09"
|
m_text: "1\uAE09"
|
||||||
m_isRightToLeft: 0
|
m_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
||||||
m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
||||||
@ -1713,7 +1713,7 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_text: "\uD654\uB791\uB098\uBE44"
|
m_text: "\uD14C\uC2A4\uD2B8\uC0BC\uBC88"
|
||||||
m_isRightToLeft: 0
|
m_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
||||||
m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2}
|
||||||
|
@ -45,6 +45,8 @@ 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("자동 로그인 실패");
|
||||||
|
@ -147,5 +147,23 @@ public class RatingPointsController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetRatingUpLimit(int winCount)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
plusImage[i].GetComponent<Image>().color = _plusColor;
|
||||||
|
scoreCountText.text = $"더 이상 승급 할 수 없습니다.\n누적 {winCount} 승 하셨습니다.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetRatingDownLimit(int loseCount)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
minusImages[i].GetComponent<Image>().color = _minusColor;
|
||||||
|
scoreCountText.text = $"더 이상 강등 될 수 없습니다.\n누적 {loseCount*-1} 패 하셨습니다.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//승급, 강등시 패널을 초기화해서 띄워주는 함수 추가
|
//승급, 강등시 패널을 초기화해서 띄워주는 함수 추가
|
||||||
}
|
}
|
||||||
|
@ -70,13 +70,38 @@ public class RatingPanelController : PanelController
|
|||||||
NetworkManager.Instance.GetInfo((userInfo) =>
|
NetworkManager.Instance.GetInfo((userInfo) =>
|
||||||
{
|
{
|
||||||
_oldScore = userInfo.score;
|
_oldScore = userInfo.score;
|
||||||
// TODO: oldscore가 더이상 강등될 수 없는 상태, 더이상 승급할 수 없는 상태임을 체크해서 더이상 ~할 수 없습니다. 처리하기
|
// 1급이고 이미 10승 이상인 경우
|
||||||
if (_myRating == 1 && userInfo.score >= requiredScore )
|
//TODO: IF문 줄일 수 있을 것 같은데 머리가 안돕니다. ..
|
||||||
|
if (_myRating == 1 && userInfo.score >= 10 )
|
||||||
{
|
{
|
||||||
|
// 10승에서 패배한 경우 점수 잃는 애니메이션
|
||||||
|
if (gameResult == Enums.GameResult.Lose && userInfo.score == 10)
|
||||||
|
{
|
||||||
|
_ratingPointsController.InitRatingPoints(_oldScore,_gameResult,requiredScore);
|
||||||
}
|
}
|
||||||
else if (_myRating == 18 && userInfo.score <= requiredScore*2)
|
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
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user