0
我想在Unity中產生一組座標的預製,但是這種情況不斷出現。'Spawning.SpawnCube'是一個'字段',但'方法組'被期望
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spawning : MonoBehaviour {
public GameObject TestCube;
public GameObject SpawnCube;
public float CubeFallTime = 7.0f;
public Vector3 Pos;
void Start()
{
StartCoroutine(SpawnCube());
}
IEnumerator Spawn()
{
yield return new WaitForSeconds(CubeFallTime);
Instantiate(TestCube, new Vector3(0, 6, 0), Quaternion.identity);
}
}