Merging all the things

Adding in the spawning and treat picking up.
This commit is contained in:
Walter
2026-01-31 15:34:32 -06:00
parent 85e34297ce
commit 77d2abd60c
22 changed files with 2632 additions and 702 deletions
+28
View File
@@ -0,0 +1,28 @@
using System.Collections;
using UnityEngine;
public class Spawner : MonoBehaviour
{
// Reference to the Prefab to Spawn
[SerializeField] private GameObject objectToSpawn;
// Time interval between spawns
public float spawnInterval = 1f;
void Start()
{
// Start the spawning process using a Coroutine
StartCoroutine(SpawnRoutine());
}
private IEnumerator SpawnRoutine()
{
// Infinite loop to keep spawning (can be modified)
while (true)
{
// Wait for the specified interval
yield return new WaitForSeconds(spawnInterval);
// Spawn the object at the spawner's position and rotation
Instantiate(objectToSpawn, transform.position, Quaternion.identity);
}
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 14b0bf07aa1abc44a8ebd00cecacd6f4