Nextrek
Diff Revisions
125
vs
126
for /3DSpace/Assets/Custum/Scripts/LaunchMissile.cs
|
@@ -6,18 +6,19 @@ |
6 |
6 |
|
public Transform startPos; |
7 |
7 |
|
public Transform missile; |
8 |
8 |
|
public AudioClip soundEffect; |
|
9 |
+ |
|
9 |
10 |
|
void Update () |
10 |
11 |
|
{ |
11 |
12 |
|
if(Input.GetKeyDown(KeyCode.LeftControl)) |
12 |
13 |
|
{ |
13 |
|
- |
//if(bullets.bullets_n>0) |
|
14 |
+ |
if(bullets.bullets_n>0) |
14 |
15 |
|
{ |
15 |
16 |
|
Transform heroSpaceShip = GameManager.GetHero(); |
16 |
17 |
|
if (heroSpaceShip==null) return; |
17 |
18 |
|
|
18 |
|
- |
Transform miss = (Transform)Instantiate(missile,startPos.position,heroSpaceShip.transform.rotation); |
|
19 |
+ |
Instantiate(missile, startPos.position, heroSpaceShip.transform.rotation); |
19 |
20 |
|
|
20 |
|
- |
//bullets.bullets_n--; |
|
21 |
+ |
bullets.bullets_n--; |
21 |
22 |
|
if(soundEffect!=null)audio.PlayOneShot(soundEffect); |
22 |
23 |
|
} |
23 |
24 |
|
} |