メテオを生み出す装置を作成する
メテオを生み出す装置の作成
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
他のコースを見るメテオを生み出す装置の作成
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);
}
}
}
}
メテオを生み出す装置を作成する