1
2
3
4
5
6
|
void Update () {
score = gamePlayer.transform.position.y;
//소수점부분은 제외하고 정수부분만 표시가 되게
string temp = score.ToString ("N0");
GetComponent<Text> ().text = temp + "M";
}
| cs |
그래서 score값을 처음에 0으로 주고 position값이 score값보다 클때만 position값을 가져오
는 식으로 바꿔 주었다.
1
2
3
4
5
6
7
|
void Update () {
if (gamePlayer.transform.position.y >= score) {
score = gamePlayer.transform.position.y;
}
string temp = score.ToString ("N0");
GetComponent<Text> ().text = temp + "M";
}
| cs |
댓글 없음:
댓글 쓰기