jetzt richtig

This commit is contained in:
2024-04-05 14:34:32 +02:00
parent e7d5add835
commit 39034193c1
9 changed files with 30 additions and 17 deletions

View File

@ -34,6 +34,7 @@ public class NPC_Behavior : MonoBehaviour
private GameManager _gameManager;
private DeveloperNeeds _developerNeeds;
private bool spawned = true;
// Start is called before the first frame update
void Start()
@ -46,9 +47,11 @@ public class NPC_Behavior : MonoBehaviour
void Update()
{
// fire event
if (UnityEngine.Random.Range(0, 60) == 0)
if (spawned)
{
Debug.Log("TEST");
spawned = false;
List<string> needs = new List<string>() { "coffee", "mate", "toilet", "money" };
_developerNeeds.spawnNeed(needs[UnityEngine.Random.Range(0, 3)]);
}
}