using System.Collections; using System.Collections.Generic; using UnityEngine; public class MonsterCreate : MonoBehaviour { public GameObject MonsterPrefab; // Start is called before the first frame update void Start() { InvokeRepeating("MonsterAdd", 0.1f, 7); //Invoke("MonsterAdd", 0.1f); } void MonsterAdd() { //方法2:使用目前this節點的transform變動組件 //使用目前節點MonsterFolder來生成怪物節點的transform(變換組件,可設定坐標,旋轉角度,縮放scale) //第一個參數:是prefab //第二個參數transform,乃是設定生成物件的位置,旋轉角度,縮放比例) GameObject node = Instantiate(MonsterPrefab, this.transform); } // Update is called once per frame void Update() { } }