質問するログイン新規登録

質問編集履歴

1

変数名を修正

2019/08/12 01:04

投稿

tamamo
tamamo

スコア13

title CHANGED
File without changes
body CHANGED
@@ -75,7 +75,7 @@
75
75
  using System.Collections.Generic;
76
76
  using UnityEngine;
77
77
 
78
- public class igaguriController : MonoBehaviour
78
+ public class BallController : MonoBehaviour
79
79
  {
80
80
  private Rigidbody _rigidBody;
81
81
 
@@ -101,18 +101,18 @@
101
101
  using System.Collections.Generic;
102
102
  using UnityEngine;
103
103
 
104
- public class igaguriGenerator : MonoBehaviour
104
+ public class BallGenerator : MonoBehaviour
105
105
  {
106
- public GameObject igaguriPrefab;
106
+ public GameObject ballPrefab;
107
- private GameObject _igaguri;
107
+ private GameObject _ball;
108
- private igaguriController _igaguriController;
108
+ private BallController _ballController;
109
109
 
110
110
  // Start is called before the first frame update
111
111
  void Start()
112
112
  {
113
113
  // ここでInstantiateを使うと、クリック前にオブジェクトが生成されてしまう。
114
- // _igaguri = Instantiate(igaguriPrefab) as GameObject;
114
+ // _ball = Instantiate(ballPrefab) as GameObject;
115
- // _igaguriController = _igaguri.GetComponent<igaguriController>();
115
+ // _ballController = _ball.GetComponent<BallController>();
116
116
  }
117
117
 
118
118
 
@@ -120,8 +120,8 @@
120
120
  void Update()
121
121
  {
122
122
  if (Input.GetMouseButton(0)) {
123
- _igaguri = Instantiate(igaguriPrefab) as GameObject;
123
+ _ball = Instantiate(ballPrefab) as GameObject;
124
- _igaguri.GetComponent<igaguriController>().Shoot(new Vector3(0, 200, 2000));
124
+ _ball.GetComponent<BallController>().Shoot(new Vector3(0, 200, 2000));
125
125
  }
126
126
  }
127
127
  }