public T FetchFromPool() { if (PoolStack.Count > 0) { return(PoolStack.Pop()); } else { return(CreatePooledObject()); } }
public PoolObject GetInstance() { if (stack.Count > 0) { var obj = stack.Pop(); if (obj == null) { return(GetInstance()); } obj.gameObject.SetActive(true); return(obj); } return(Instantiate(this)); }