回答編集履歴
3
文章が変でした
answer
CHANGED
@@ -5,17 +5,21 @@
|
|
5
5
|
{
|
6
6
|
public bool grounded;
|
7
7
|
// 省略
|
8
|
+
|
8
|
-
|
9
|
+
public bool IsGround()
|
10
|
+
{
|
11
|
+
return grounded;
|
12
|
+
}
|
9
13
|
}
|
10
14
|
|
11
15
|
public class FallingBlockController : MonoBehaviour
|
12
16
|
{
|
13
17
|
|
14
|
-
[
|
18
|
+
[SerializeField] PlayerController player;
|
15
19
|
bool isGround;
|
16
20
|
|
17
21
|
public void Start() {
|
18
|
-
isGround = player.
|
22
|
+
isGround = player.IsGround();
|
19
23
|
}
|
20
24
|
|
21
25
|
public void Update()
|
2
修正
answer
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
bool isGround;
|
16
16
|
|
17
17
|
public void Start() {
|
18
|
-
|
18
|
+
isGround = player.grounded;
|
19
19
|
}
|
20
20
|
|
21
21
|
public void Update()
|
1
変数名の修正
answer
CHANGED
@@ -12,15 +12,15 @@
|
|
12
12
|
{
|
13
13
|
|
14
14
|
[SerializedField] PlayerController player;
|
15
|
-
bool
|
15
|
+
bool isGround;
|
16
16
|
|
17
17
|
public void Start() {
|
18
|
-
grounded = player.
|
18
|
+
grounded = player.grounded;
|
19
19
|
}
|
20
20
|
|
21
21
|
public void Update()
|
22
22
|
{
|
23
|
-
if(
|
23
|
+
if(isGround && crush) {
|
24
24
|
GameOver();
|
25
25
|
}
|
26
26
|
}
|