Subversion Repository Public Repository

Nextrek

Diff Revisions 120 vs 122 for /3DSpace/Assets/Custum/Scripts/CommunicationCenter.cs

Diff revisions: vs.
  @@ -49,7 +49,8 @@
49 49 for(int i=0;i<allies;i++)
50 50 {
51 51
52 - Transform tp = Instantiate(allyPrefeb)as Transform;
52 + Transform tp = Instantiate(allyPrefeb) as Transform;
53 + tp.gameObject.tag = "Ally";
53 54 }
54 55 }
55 56 void LoadDataOfMission(int missionID)
  @@ -128,25 +129,25 @@
128 129 }
129 130 }
130 131
131 - public void DestroyOneEnemy(int id)
132 + public void DestroyOneEnemy(GameObject enemy)
132 133 {
133 - EnemyPool.Instance.DestroyOneEnemy(id);
134 + EnemyPool.Instance.DestroyOneEnemy(enemy);
134 135 ShowSmallCamera(true);
135 136 MessageWindow.Instance.NewMessage("An enemy ship has been destroyed!");
136 137 haveToKill--;
137 138 }
138 139
139 - public void DestroyOneAlly(int id)
140 + public void DestroyOneAlly(GameObject ally)
140 141 {
141 - AllyPool.Instance.DestroyOneAlly(id);
142 + //AllyPool.Instance.DestroyOneAlly(ally);
142 143 ShowSmallCamera1(true);
143 144 MessageWindow.Instance.NewMessage("An ally ship has been destroyed!");
144 145 haveToKill--;
145 146 }
146 147
147 - public void AllyDestroyOneEnemy(int id)
148 + public void AllyDestroyOneEnemy(GameObject enemy)
148 149 {
149 - EnemyPool.Instance.DestroyOneEnemy(id);
150 + EnemyPool.Instance.DestroyOneEnemy(enemy);
150 151 ShowSmallCamera(true);
151 152 MessageWindow.Instance.NewMessage("An ally destroyed one enemy ship!");
152 153 haveToKill--;
  @@ -217,7 +218,7 @@
217 218 public void WinGame()
218 219 {
219 220 finished = true;
220 - SU_Spaceship ship = GameManager.Instance.spaceShip.GetComponent<SU_Spaceship>();
221 + SU_Spaceship ship = GameManager.GetHero().GetComponent<SU_Spaceship>();
221 222 ship.Finish();
222 223 GlobalObject.Instance.WinThisLevel(true);
223 224 }
  @@ -225,9 +226,9 @@
225 226 public void FailGame()
226 227 {
227 228 finished = true;
228 - if(GameManager.Instance.spaceShip!=null)
229 + if(GameManager.GetHero()!=null)
229 230 {
230 - GameManager.Instance.spaceShip.gameObject.SetActive(false);
231 + GameManager.GetHero().gameObject.SetActive(false);
231 232 }
232 233 GlobalObject.Instance.WinThisLevel(false);
233 234 }