Nextrek
Diff Revisions
133
vs
134
for /3DSpace/Assets/Custum/Scripts/LaunchMissile.cs
|
@@ -16,7 +16,12 @@ |
16 |
16 |
|
Transform heroSpaceShip = GameManager.GetHero(); |
17 |
17 |
|
if (heroSpaceShip==null) return; |
18 |
18 |
|
|
19 |
|
- |
Instantiate(missile, startPos.position, heroSpaceShip.transform.rotation); |
|
19 |
+ |
Transform tp = Instantiate(missile, startPos.position, heroSpaceShip.transform.rotation) as Transform; |
|
20 |
+ |
Missile m = tp.gameObject.GetComponent<Missile>(); |
|
21 |
+ |
if (m!=null) |
|
22 |
+ |
{ |
|
23 |
+ |
m.SetFiredBy(GameManager.GetHero()); |
|
24 |
+ |
} |
20 |
25 |
|
|
21 |
26 |
|
bullets.bullets_n--; |
22 |
27 |
|
if(soundEffect!=null)audio.PlayOneShot(soundEffect); |