回答編集履歴

3

文章が変でした

2019/12/15 08:22

投稿

madone99
madone99

スコア1855

test CHANGED
@@ -12,7 +12,15 @@
12
12
 
13
13
  // 省略
14
14
 
15
+
15
16
 
17
+ public bool IsGround()
18
+
19
+ {
20
+
21
+ return grounded;
22
+
23
+ }
16
24
 
17
25
  }
18
26
 
@@ -24,7 +32,7 @@
24
32
 
25
33
 
26
34
 
27
- [SerializedField] PlayerController player;
35
+ [SerializeField] PlayerController player;
28
36
 
29
37
  bool isGround;
30
38
 
@@ -32,7 +40,7 @@
32
40
 
33
41
  public void Start() {
34
42
 
35
- isGround = player.grounded;
43
+ isGround = player.IsGround();
36
44
 
37
45
  }
38
46
 

2

修正

2019/12/15 08:22

投稿

madone99
madone99

スコア1855

test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  public void Start() {
34
34
 
35
- grounded = player.grounded;
35
+ isGround = player.grounded;
36
36
 
37
37
  }
38
38
 

1

変数名の修正

2019/12/15 08:15

投稿

madone99
madone99

スコア1855

test CHANGED
@@ -26,13 +26,13 @@
26
26
 
27
27
  [SerializedField] PlayerController player;
28
28
 
29
- bool grounded;
29
+ bool isGround;
30
30
 
31
31
 
32
32
 
33
33
  public void Start() {
34
34
 
35
- grounded = player.bool;
35
+ grounded = player.grounded;
36
36
 
37
37
  }
38
38
 
@@ -42,7 +42,7 @@
42
42
 
43
43
  {
44
44
 
45
- if(grounded && crush) {
45
+ if(isGround && crush) {
46
46
 
47
47
  GameOver();
48
48