Exemplo n.º 1
0
 void FireHandling()
 {
     if (Input.GetKey(KeyCode.Mouse0))
     {
         machinGun.Fire(transform.up);
     }
     if (Input.GetKey(KeyCode.Mouse1))
     {
         launcher.Fire(transform.up);
     }
 }
Exemplo n.º 2
0
 public void FireMissile()
 {
     MissileLauncher[] gos = GetComponentsInChildren <MissileLauncher>();
     if (gos.Length > 0)
     {
         int             random = UnityEngine.Random.Range(0, gos.Length);
         MissileLauncher l      = gos[random];
         GameObject      target = new GameObject("Target for " + Info.UnitName);
         target.transform.position = transform.TransformDirection(Vector3.forward * 1000) + transform.position;
         l.Fire(target);
     }
 }
Exemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.M))
     {
         MissileLauncher[] gos = GetComponentsInChildren <MissileLauncher>();
         if (gos.Length > 0)
         {
             int             random = UnityEngine.Random.Range(0, gos.Length);
             MissileLauncher l      = gos[random];
             GameObject      target = new GameObject("Target");
             target.transform.position = transform.TransformDirection(Vector3.forward * 1000) + transform.position;
             l.Fire(target);
         }
     }
 }
Exemplo n.º 4
0
 private void fireButton_Click(object sender, EventArgs e)
 {
     _launcher.Fire();
 }
Exemplo n.º 5
0
 public void FireMissiles()
 {
     _missileLauncher.Fire();
 }