protected ElementObject CreateNewObject() { ElementObject newPoolObject = new ElementObject(); newPoolObject.instance = Instantiate(element); newPoolObject.inPool = true; newPoolObject.instance.transform.SetParent(transform); newPoolObject.SetReferences(); newPoolObject.Sleep(); return(newPoolObject); }
public void Push(ElementObject element) { element.inPool = true; element.Sleep(); }