23 lines
538 B
C#
23 lines
538 B
C#
using UnityEngine;
|
|
|
|
namespace DamageNumbersPro.Demo
|
|
{
|
|
public class DNP_CubeSpawner : MonoBehaviour
|
|
{
|
|
public float delay = 0.2f;
|
|
public GameObject cube;
|
|
|
|
private void Start()
|
|
{
|
|
InvokeRepeating("SpawnCube", 0, delay);
|
|
}
|
|
|
|
private void SpawnCube()
|
|
{
|
|
var newCube = Instantiate(cube);
|
|
newCube.SetActive(true);
|
|
newCube.transform.SetParent(transform, true);
|
|
newCube.transform.localScale = Vector3.one;
|
|
}
|
|
}
|
|
} |