メテオを生み出す装置を作成する
![272cf681 c8c3 4e14 9263 772678b83f36](https://codegenius.org/uploads/slide/image/1364/272cf681-c8c3-4e14-9263-772678b83f36.jpeg)
メテオを生み出す装置の作成
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeteoGene : MonoBehaviour {
public GameObject meteoPrefab;
private Vector3 pos;
void Start () {
pos = transform.position;
// メテオを広範囲に降らせるための工夫
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
Instantiate (meteoPrefab, new Vector3(pos.x + (60 * i), 12, pos.z + (60 * j)), Quaternion.identity);
}
}
}
}
Unity Code Memo
他のコースを見る![272cf681 c8c3 4e14 9263 772678b83f36](https://codegenius.org/uploads/slide/image/1364/272cf681-c8c3-4e14-9263-772678b83f36.jpeg)
メテオを生み出す装置の作成
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeteoGene : MonoBehaviour {
public GameObject meteoPrefab;
private Vector3 pos;
void Start () {
pos = transform.position;
// メテオを広範囲に降らせるための工夫
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
Instantiate (meteoPrefab, new Vector3(pos.x + (60 * i), 12, pos.z + (60 * j)), Quaternion.identity);
}
}
}
}
メテオを生み出す装置を作成する