Skip to content

Commit db90e58

Browse files
committed
Despawning with one parameter
1 parent aaab477 commit db90e58

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Assets/CustomTools/ObjectPooling/Scripts/ObjectPool/ObjectPooler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ public GameObject SpawnFromPool(PooledObjectType tag, Vector3 pos, Quaternion ro
8989
return objToSpawn;
9090
}
9191

92-
public void Despawn(PooledObjectType tag, GameObject obj)
92+
public void Despawn(GameObject obj)
9393
{
94-
94+
PooledObjectType tag = obj.GetComponent<IPooledObject>().PoolType;
9595
PoolDictionary[tag].Enqueue(obj);
9696

9797
IPooledObject iPooledObj = obj.GetComponent<IPooledObject>();

Assets/CustomTools/ObjectPooling/Scripts/ObjectPool/PooledObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public virtual void Init()
2525

2626
public void Despawn()
2727
{
28-
ObjectPooler.Instance.Despawn(PoolType, gameObject);
28+
ObjectPooler.Instance.Despawn(gameObject);
2929
}
3030

3131

0 commit comments

Comments
 (0)