rabidus-test/Assets/Scripts/DebugSpawner.cs

26 lines
502 B
C#
Raw Permalink Normal View History

2023-09-11 15:44:17 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DebugSpawner : MonoBehaviour
{
public Transform SpawnPoint;
public GameObject Prefab;
public TMPro.TextMeshProUGUI _count;
private int count = 0;
public void Spawn()
{
count++;
_count.SetText(count.ToString());
Instantiate(Prefab, SpawnPoint);
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
Spawn();
}
}