質問編集履歴
1
Update部分を追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,11 +16,33 @@
|
|
16
16
|
|
17
17
|
public GameObject[] testPrefabs
|
18
18
|
|
19
|
+
float timeleft;
|
20
|
+
|
19
21
|
|
20
22
|
|
21
23
|
void Start () {
|
22
24
|
|
23
25
|
GameObject obj = Instantiate(testPrefabs[0], this.transform.position, Quaternion.identity) as GameObject;
|
26
|
+
|
27
|
+
}
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
//質問後に抜けてました。すみません(2/5 0:10)
|
32
|
+
|
33
|
+
void Update(){
|
34
|
+
|
35
|
+
//1秒ごとに生成
|
36
|
+
|
37
|
+
timeleft -= Time.deltaTime;
|
38
|
+
|
39
|
+
if (timeleft <= 0.0) {
|
40
|
+
|
41
|
+
timeleft = 1.0f;
|
42
|
+
|
43
|
+
GameObject obj = Instantiate(testPrefabs[0], this.transform.position, Quaternion.identity) as GameObject;
|
44
|
+
|
45
|
+
}
|
24
46
|
|
25
47
|
}
|
26
48
|
|