public void AddObject() { PointGainVisualisationText textObject = Instantiate(textPrefab); textObject.transform.parent = mainUI.transform; textObject.transform.localPosition = textPrefab.transform.localPosition; textObject.InitObject(); textObject.gameObject.SetActive(false); textVisualPool.Enqueue(textObject); }
public void GetObject(string textValue) { //Debug.Log("Get text visualisation"); if (textVisualPool.Count == 0) { AddObject(); } PointGainVisualisationText textObject = textVisualPool.Dequeue(); textObject.SetText(textValue); textObject.gameObject.SetActive(true); textObject.StartAnimation(); }
public void BackToPool(PointGainVisualisationText textObject) { textObject.ResetY(); textObject.gameObject.SetActive(false); textVisualPool.Enqueue(textObject); }