refactor: list pool initial count and capacity parameters added
This commit is contained in:
@@ -25,11 +25,11 @@ public class PhysicsEngine2D : Behaviour, IPreUpdate, IPhysicsEngine2D
|
||||
protected BehaviourCollector<IRigidBody2D> rigidBodyCollector = new();
|
||||
protected BehaviourCollector<ICollider2D> colliderCollector = new();
|
||||
|
||||
private readonly ListPool<ICollider2D> colliderPool = new(() => new(32));
|
||||
private readonly ListPool<IPrePhysicsUpdate> prePhysicsUpdatePool = new(() => new(32));
|
||||
private readonly ListPool<IPhysicsUpdate> physicsUpdatePool = new(() => new(32));
|
||||
private readonly ListPool<IPhysicsIteration> physicsIterationPool = new(() => new(32));
|
||||
private readonly ListPool<IPostPhysicsUpdate> postPhysicsUpdatePool = new(() => new(32));
|
||||
private readonly ListPool<ICollider2D> colliderPool = new();
|
||||
private readonly ListPool<IPrePhysicsUpdate> prePhysicsUpdatePool = new();
|
||||
private readonly ListPool<IPhysicsUpdate> physicsUpdatePool = new();
|
||||
private readonly ListPool<IPhysicsIteration> physicsIterationPool = new();
|
||||
private readonly ListPool<IPostPhysicsUpdate> postPhysicsUpdatePool = new();
|
||||
|
||||
public int IterationPerStep { get => _iterationPerStep; set => _iterationPerStep = value < 1 ? 1 : value; }
|
||||
public float IterationPeriod { get => _iterationPeriod; set => _iterationPeriod = value.Max(0.0001f); }
|
||||
|
Reference in New Issue
Block a user