Initial Commit
This commit is contained in:
commit
ee5c2f922d
2255 changed files with 547750 additions and 0 deletions
20
Assets/Scripts/Util/ProjectilePool.cs
Normal file
20
Assets/Scripts/Util/ProjectilePool.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public class ProjectilePool
|
||||
{
|
||||
public Stack<GameObject> projectiles = new Stack<GameObject>();
|
||||
|
||||
public void AddToPool(GameObject projectile)
|
||||
{
|
||||
projectiles.Push(projectile);
|
||||
}
|
||||
|
||||
public GameObject GetFree()
|
||||
{
|
||||
return projectiles.Peek();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue