2D-Platformer/Assets/Scripts/Util/ProjectilePool.cs
2022-02-12 12:53:50 +02:00

20 lines
No EOL
346 B
C#

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();
}
}
}