how do i limit the amount of prefabs in unity using c# script code example
Example 1: how do i limit the amount of prefabs in unity using c# script
CancelInvoke("Spawn");
Example 2: how do i limit the amount of prefabs in unity using c# script
int maxEnemy = 50; int enemyCount = 0; void Spawn() { if(enemyCount >= maxEnemy) return; // Instantiate enemyCount++; }