private Ball GetBall(Transform parent) { if (_pool.Contains(typeof(Ball))) { Ball ball = _pool.GetObj(typeof(Ball)) as Ball; ball.transform.SetParent(parent); ball.gameObject.SetActive(true); return(ball); } return(Instantiate(_ballPrefab, parent)); }