Check out example codes for "how do i limit the amount of prefabs in unity using c# script". It will help you in understanding the concepts better.

Code Example 1


Code Example 2

int maxEnemy = 50; int enemyCount = 0;  void Spawn() {     if(enemyCount >= maxEnemy) return;     // Instantiate     enemyCount++; }

Learn ReactJs, React Native from