質問編集履歴
2
参考にしているソースを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -125,3 +125,43 @@
|
|
125
125
|
|
126
126
|
|
127
127
|
}
|
128
|
+
|
129
|
+
参考にしているソースです
|
130
|
+
|
131
|
+
using UnityEngine;
|
132
|
+
|
133
|
+
using System.Collections;
|
134
|
+
|
135
|
+
public class Player : MonoBehaviour {
|
136
|
+
|
137
|
+
// 移動スピード
|
138
|
+
|
139
|
+
public float speed = 5;
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
// PlayerBulletプレハブ
|
144
|
+
|
145
|
+
public GameObject bullet;
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
// Startメソッドをコルーチンとして呼び出す
|
150
|
+
|
151
|
+
IEnumerator Start ()
|
152
|
+
|
153
|
+
{
|
154
|
+
|
155
|
+
while (true) {
|
156
|
+
|
157
|
+
// 弾をプレイヤーと同じ位置/角度で作成
|
158
|
+
|
159
|
+
Instantiate (bullet, transform.position, transform.rotation);
|
160
|
+
|
161
|
+
// 0.05秒待つ
|
162
|
+
|
163
|
+
yield return new WaitForSeconds (0.05f);
|
164
|
+
|
165
|
+
}
|
166
|
+
|
167
|
+
}
|
1
初心者マーク
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|