Subversion Repository Public Repository

Nextrek

Diff Revisions 138 vs 139 for /3DSpace/Assets/Custum/Scripts/EnemyPool.cs

Diff revisions: vs.
  @@ -33,6 +33,12 @@
33 33
34 34 public void InsertEnemy(int type,int cnt)
35 35 {
36 + if ((type < 0) || (type > (enemyPrefeb.Length-1)))
37 + {
38 + Debug.LogError("type " + type + ", cannot be used. Discarding " + cnt + " enemies!");
39 + return;
40 + }
41 +
36 42 totalEnemies += cnt;
37 43
38 44 for(int i=0;i<cnt;i++)