Example #1
0
 public void ShootBullet(Vector2 pos)
 {
     if (pool != null && firePoint != null)
     {
         Vector2 relative = pos - Rigidbody.position;
         float rot = (float)Math.Atan2(relative.y, relative.x) * Mathf.Rad2Deg;
         pool.GetAt(firePoint.position, rot).Fire(this,1);
     }
 }
Example #2
0
    protected virtual void Fire()
    {
        Bullet bullet = pool.GetAt(SpawnPos.position, Rigidbody.rotation);

        if (bullet != null)
        {
            canFire = false;
            bullet.Fire(Owner, info.BulletDamageMultiplier);
            Invoke("ResetCD", info.FireRate);
        }
    }