Subversion Repository Public Repository

Nextrek

Diff Revisions 147 vs 148 for /3DSpace/Assets/Custum/Scripts/CommunicationCenter.cs

Diff revisions: vs.
  @@ -38,6 +38,8 @@
38 38 public float tempoCamera2 = 7.5f;
39 39 public float tempoCamera3 = 12.5f;
40 40
41 + private static float BLAST_RANGE = 500.0f;
42 +
41 43 private TimeWindow timeWindow;
42 44
43 45 private bool finished = false;
  @@ -169,6 +171,14 @@
169 171 }
170 172 }
171 173
174 + public void CheckCollisionBlast(GameObject destroyedShip)
175 + {
176 + if (Vector3.Distance(GameManager.GetHero().position, destroyedShip.transform.position) < BLAST_RANGE)
177 + {
178 + followCamera.animation.Play ();
179 + }
180 + }
181 +
172 182 public void DestroyOneEnemy(GameObject enemy)
173 183 {
174 184 ShowSmallCamera(true);
  @@ -177,9 +187,9 @@
177 187 if (cmp != null)
178 188 {
179 189 MessageWindow.Instance.NewMessage(cmp.getPilotName() + " enemy's ship has been destroyed!");
180 - followCamera.animation.Play ();
181 -
182 190 }
191 +
192 + CheckCollisionBlast(enemy);
183 193 EnemyPool.Instance.DestroyOneEnemy(enemy);
184 194 haveToKill--;
185 195 }
  @@ -190,7 +200,7 @@
190 200
191 201 //AllyPool.Instance.DestroyOneAlly(ally);
192 202 MessageWindow.Instance.NewMessage("An ally ship has been destroyed!");
193 - followCamera.animation.Play ();
203 + CheckCollisionBlast(ally);
194 204 //haveToKill--;
195 205 }
196 206
  @@ -201,9 +211,9 @@
201 211 if (cmp != null)
202 212 {
203 213 MessageWindow.Instance.NewMessage(cmp.getPilotName() + " enemy's ship has been destroyed by an ally!");
204 - followCamera.animation.Play ();
205 214 }
206 215
216 + CheckCollisionBlast(enemy);
207 217 EnemyPool.Instance.DestroyOneEnemy(enemy);
208 218 haveToKill--;
209 219 }