using UniRx.Toolkit;
using UnityEngine;

public class SimpleObjectPool<T> : ObjectPool<T> where T : Component {

    private readonly T prefab;
    private readonly Transform parentTransform;

    public SimpleObjectPool(T prefab, Transform parentTransform = null){
        this.prefab = prefab;
        this.parentTransform = parentTransform;
    }

    protected override T CreateInstance(){
        return GameObject.Instantiate<T>(prefab, parentTransform);
    }
}
