Skip to content

Commit

Permalink
Update ObjectPool.cs
Browse files Browse the repository at this point in the history
Added the spawn function to the second constructor. This allows a number of objects to be pre-spawned.
  • Loading branch information
onewheelstudio committed Mar 3, 2022
1 parent e3831c7 commit f9b455e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Object Pool 2/ObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public ObjectPool(GameObject pooledObject, Action<T> pullObject, Action<T> pushO
this.prefab = pooledObject;
this.pullObject = pullObject;
this.pushObject = pushObject;
Spawn(numToSpawn);
}

private System.Action<T> pullObject;
Expand Down

0 comments on commit f9b455e

Please sign in to comment.