[Feat] 1급에서 승급 18급에서 강등 안되도록 구현중
This commit is contained in:
parent
78ff91d4ef
commit
6c24679a86
@ -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}
|
||||
|
@ -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} 게임을 승리하면 승급하게 됩니다.";
|
||||
//강등되는 경우에도 텍스트 처리
|
||||
}
|
||||
}
|
||||
|
||||
//승급, 강등시 패널을 초기화해서 띄워주는 함수 추가
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
}, () =>
|
||||
{ });
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user