回答編集履歴
4
ソースコード変更
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
追記2を修正して下記で良いかと思います。
|
2
2
|
|
3
|
-
```
|
3
|
+
```C#
|
4
4
|
using System.Collections;
|
5
5
|
using System.Collections.Generic;
|
6
6
|
using UnityEngine;
|
3
ソースコード変更
answer
CHANGED
@@ -17,8 +17,7 @@
|
|
17
17
|
scoreText.text = Rscore.ToString ();
|
18
18
|
highScore = PlayerPrefs.GetInt(key, 0);
|
19
19
|
//保存しておいたハイスコアをキーで呼び出し取得し保存されていなければ0になる
|
20
|
-
|
20
|
+
|
21
|
-
//ハイスコアを表示
|
22
21
|
if (Rscore > highScore) {
|
23
22
|
|
24
23
|
highScore = Rscore;
|
@@ -27,10 +26,9 @@
|
|
27
26
|
PlayerPrefs.SetInt(key, highScore);
|
28
27
|
PlayerPrefs.Save ();
|
29
28
|
//ハイスコアを保存
|
30
|
-
|
31
|
-
highScoreText.text = "HighScore:" + highScore.ToString();
|
32
|
-
//ハイスコアを表示
|
33
29
|
}
|
30
|
+
highScoreText.text = "HighScore:" + highScore.ToString();
|
31
|
+
//ハイスコアを表示
|
34
32
|
}
|
35
33
|
}
|
36
34
|
```
|
2
ソースコード変更
answer
CHANGED
@@ -28,7 +28,8 @@
|
|
28
28
|
PlayerPrefs.Save ();
|
29
29
|
//ハイスコアを保存
|
30
30
|
|
31
|
-
|
31
|
+
highScoreText.text = "HighScore:" + highScore.ToString();
|
32
|
+
//ハイスコアを表示
|
32
33
|
}
|
33
34
|
}
|
34
35
|
}
|
1
ソースコード変更
answer
CHANGED
@@ -27,6 +27,8 @@
|
|
27
27
|
PlayerPrefs.SetInt(key, highScore);
|
28
28
|
PlayerPrefs.Save ();
|
29
29
|
//ハイスコアを保存
|
30
|
+
|
31
|
+
highScoreText.text = "HighScore:" + highScore.ToString();
|
30
32
|
}
|
31
33
|
}
|
32
34
|
}
|