public static MuzzleLuz Acquire(Matrix offset, float life, float scale) { MuzzleLuz muzzle = null; Luz luz = Luz.Acquire(Luz.LuzGroup.Fire); if (luz != null) { muzzle = Get(offset); muzzle.age = 0; muzzle.Luz = luz; muzzle.Life = life; muzzle.InitRadii(); muzzle.ScaleRadii(scale); } return(muzzle); }
private static MuzzleLuz Get(Matrix offset) { MuzzleLuz muzzle = null; if (available.Count == 0) { muzzle = new MuzzleLuz(offset); ready.Add(muzzle); } else { muzzle = available[available.Count - 1]; available.RemoveAt(available.Count - 1); ready.Add(muzzle); muzzle.Offset = offset; } return(muzzle); }