34 lines
840 B
C#
34 lines
840 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
namespace Assets.Scenes.Ride.Scripts
|
|
{
|
|
public class PlayerItemFactory : MonoBehaviour
|
|
{
|
|
public GameObject prefab; // This is our prefab object that will be exposed in the inspector
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
Populate();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
void Populate()
|
|
{
|
|
GameObject newObj; // Create GameObject instance
|
|
|
|
for (int i = 0; i < 16; i++)
|
|
{
|
|
// Create new instances of our prefab until we've created as many as we specified
|
|
newObj = (GameObject)Instantiate(prefab, transform);
|
|
}
|
|
}
|
|
}
|
|
}
|