Exemplo n.º 1
0
    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);
        }
    }
Exemplo n.º 2
0
    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);
    }