Exemple #1
0
 void Fire()
 {
     foreach (Transform g in bulletSpawns)
     {
         GameObject bullet = _bulletPool.GetPooledObject();
         if (bullet == null)
         {
             return;
         }
         bullet.transform.position = g.position;
         bullet.transform.rotation = g.rotation;
         bullet.SetActive(true);
         bullet.rigidbody.AddForce(g.forward * bulletSpeed);
         bullet.GetComponent <BulletController>().SetStats(_unitStats.damageOutput);
     }
 }
Exemple #2
0
    void Fire(Vector3 g, Quaternion r)
    {
        if (projectiles == null)
        {
            return;
        }
        GameObject bullet = projectiles.GetPooledObject();

        if (bullet == null)
        {
            return;
        }
        bullet.transform.position = g;
        bullet.transform.rotation = r;
        bullet.SetActive(true);
        bullet.rigidbody.AddForce(bullet.transform.forward * _eController.bulletSpeed);
        bullet.GetComponent <BulletController>().SetStats(GetComponent <UnitStats>().damageOutput);
    }