public void BulletClass(AnotherVec2 a_vcPos, AnotherVec2 a_vcDir, float a_fSpeed, char c) { if (BliPool.Count == 0) { BMake(nMAKE_DEFAULT_COUNT); } Bullet bullet = BliPool[BliPool.Count - 1]; BliPool.RemoveAt(BliPool.Count - 1); bullet.Init(1.5F, a_vcPos, a_vcDir, a_fSpeed, c); BliActive.Add(bullet); }
public void BulletUpdate(float a_fDelta) { BliTemp.Clear(); foreach (var val in BliActive) { val.Update(a_fDelta); if (val.bIsDie == true) { val.RenderClear(); BliTemp.Add(val); } } foreach (var val in BliTemp) { BliActive.Remove(val); BliPool.Add(val); } BliTemp.Clear(); }