I am following a tetris tutorial when it called for an array of prefabs as a part of the spawner object. The spawner would randomly create the shapes, such as the I shape, the T shape, etc. These shapes are prefabs.
public class Spawner : MonoBehaviour {
public GameObject[] blocks;
//...
}
This setup would make a custom field in the Inspector, where I can put in all the shapes that could spawn. However, this got me thinking, what if I have 1000 shapes? Surely there's a better way than filling in 1000 prefabs? Can I initialize the array without the Inspector?
Thank you for your time.