Example #1
0
    public void Shoot()
    {
        if (Fire < Bullet)
        {
            GameObject objeto = Instantiate(Bala);

            objeto.transform.position = transform.position;

            Fire++;
            //DaƱo = Random.Range (20,50);

            //print (Fire);

            Balas aux = objeto.GetComponent <Balas>();

            if (sp.flipX == true)
            {
                aux.direccion = -1;
            }
        }

        if (Fire == Bullet && TimeShooting < Reloading)
        {
            TimeShooting = 0;
            Fire         = 0;
        }
    }
Example #2
0
 void Shoot()
 {
     if (GameManager.gameEnded == false)
     {
         GameObject dirBala = (GameObject)Instantiate(prefabBala, dirBalas.position, dirBalas.rotation);
         Balas      bullet  = dirBala.GetComponent <Balas>();
         if (bullet != null)
         {
             disparo.Play();
             bullet.Skeek(target);
         }
     }
 }