private void Start() { textPool = new Queue <TextFeedbackBehaviour>(); for (int i = 0; i < textPoolLength; i++) { TextFeedbackBehaviour temp = Instantiate(textFeedbackPrefab, transform.position, Quaternion.identity, transform); textPool.Enqueue(temp); temp.gameObject.SetActive(false); } }
public TextFeedbackBehaviour GetText(BricksAbstract brickValue) { TextFeedbackBehaviour temp = textPool.Dequeue(); temp.gameObject.SetActive(true); temp.SetFeedback(brickValue.GetScore.ToString(), GameConstants.GetColorFromBrick(brickValue.GetColor), brickValue.transform.position, scoreObject.transform.position); textPool.Enqueue(temp); return(temp); }