質問編集履歴

1

変数名を修正

2019/08/12 01:04

投稿

tamamo
tamamo

スコア13

test CHANGED
File without changes
test CHANGED
@@ -152,7 +152,7 @@
152
152
 
153
153
 
154
154
 
155
- public class igaguriController : MonoBehaviour
155
+ public class BallController : MonoBehaviour
156
156
 
157
157
  {
158
158
 
@@ -204,15 +204,15 @@
204
204
 
205
205
 
206
206
 
207
- public class igaguriGenerator : MonoBehaviour
207
+ public class BallGenerator : MonoBehaviour
208
-
208
+
209
- {
209
+ {
210
-
210
+
211
- public GameObject igaguriPrefab;
211
+ public GameObject ballPrefab;
212
-
212
+
213
- private GameObject _igaguri;
213
+ private GameObject _ball;
214
-
214
+
215
- private igaguriController _igaguriController;
215
+ private BallController _ballController;
216
216
 
217
217
 
218
218
 
@@ -224,9 +224,9 @@
224
224
 
225
225
  // ここでInstantiateを使うと、クリック前にオブジェクトが生成されてしまう。
226
226
 
227
- // _igaguri = Instantiate(igaguriPrefab) as GameObject;
227
+ // _ball = Instantiate(ballPrefab) as GameObject;
228
-
228
+
229
- // _igaguriController = _igaguri.GetComponent<igaguriController>();
229
+ // _ballController = _ball.GetComponent<BallController>();
230
230
 
231
231
  }
232
232
 
@@ -242,9 +242,9 @@
242
242
 
243
243
  if (Input.GetMouseButton(0)) {
244
244
 
245
- _igaguri = Instantiate(igaguriPrefab) as GameObject;
245
+ _ball = Instantiate(ballPrefab) as GameObject;
246
-
246
+
247
- _igaguri.GetComponent<igaguriController>().Shoot(new Vector3(0, 200, 2000));
247
+ _ball.GetComponent<BallController>().Shoot(new Vector3(0, 200, 2000));
248
248
 
249
249
  }
250
250