Beispiel #1
0
        public static Bullet Bullet <TAmmoType>(Vec2 position, AmmoTypeModifier modifier, Thing owner = null, float angleDegress = 0, Thing firedFrom = null)
            where TAmmoType : AmmoType, new()
        {
            var ammoType = FastNew.CreateInstance <TAmmoType>();

            modifier(ref ammoType.bulletSpeed, ref ammoType.range);
            return(ammoType.FireBullet(position, owner, angleDegress, firedFrom));
        }
Beispiel #2
0
 public static Bullet Bullet <TAmmoType>(float x, float y, AmmoTypeModifier modifier, Thing owner = null, float angleDegress = 0, Thing firedFrom = null)
     where TAmmoType : AmmoType, new()
 => Bullet <TAmmoType>(new Vec2(x, y), modifier, owner, angleDegress, firedFrom);