Subversion Repository Public Repository

Nextrek

Diff Revisions 126 vs 127 for /3DSpace/Assets/Custum/Scripts/CommunicationCenter.cs

Diff revisions: vs.
  @@ -134,25 +134,36 @@
134 134
135 135 public void DestroyOneEnemy(GameObject enemy)
136 136 {
137 - EnemyPool.Instance.DestroyOneEnemy(enemy);
138 137 ShowSmallCamera(true);
139 - MessageWindow.Instance.NewMessage("An enemy ship has been destroyed!");
138 +
139 + PilotNameGenerator cmp = enemy.GetComponent<PilotNameGenerator>();
140 + if (cmp != null)
141 + {
142 + MessageWindow.Instance.NewMessage(cmp.getPilotName() + " enemy's ship has been destroyed!");
143 + }
144 + EnemyPool.Instance.DestroyOneEnemy(enemy);
140 145 haveToKill--;
141 146 }
142 147
143 148 public void DestroyOneAlly(GameObject ally)
144 149 {
145 - //AllyPool.Instance.DestroyOneAlly(ally);
146 150 ShowSmallCamera1(true);
151 +
152 + //AllyPool.Instance.DestroyOneAlly(ally);
147 153 MessageWindow.Instance.NewMessage("An ally ship has been destroyed!");
148 - haveToKill--;
154 + //haveToKill--;
149 155 }
150 156
151 157 public void AllyDestroyOneEnemy(GameObject enemy)
152 158 {
153 - EnemyPool.Instance.DestroyOneEnemy(enemy);
154 159 ShowSmallCamera(true);
155 - MessageWindow.Instance.NewMessage("An ally destroyed one enemy ship!");
160 + PilotNameGenerator cmp = enemy.GetComponent<PilotNameGenerator>();
161 + if (cmp != null)
162 + {
163 + MessageWindow.Instance.NewMessage(cmp.getPilotName() + " enemy's ship has been destroyed by an ally!");
164 + }
165 +
166 + EnemyPool.Instance.DestroyOneEnemy(enemy);
156 167 haveToKill--;
157 168 }
158 169
  @@ -196,11 +207,12 @@
196 207 {
197 208 if (!EnemyPool.Instance) return;
198 209
199 - if(EnemyPool.Instance.aliveEnemy<=0)
210 + if(EnemyPool.Instance.getRemainingEnemiesToKill() == 0)
200 211 {
201 212 WinGame();
202 213 return;
203 214 }
215 +
204 216 if(timeLimit==TimeLimit.RESIST && timeWindow.timeToShow<=0 && haveToKill<=0)
205 217 {
206 218 WinGame();