void AddObject() { PointTextUI textPointObject = Instantiate(_textUIPoint); textPointObject.InitObject(); textPointObject.gameObject.SetActive(false); textUIPool.Enqueue(textPointObject); }
public void GetObject(Vector3 playerPosition, string textMsg) { //Debug.Log("GetObject"); if (textUIPool.Count == 0) { AddObject(); } PointTextUI textPointObject = textUIPool.Dequeue(); textPointObject.SetObjectStartPosition(playerPosition); textPointObject.SetObjectText(textMsg); textPointObject.gameObject.SetActive(true); textPointObject.StartObjectAnimation(); }
public void BackToPool(PointTextUI textPoint) { //Debug.Log("Back To pool"); textPoint.gameObject.SetActive(false); textUIPool.Enqueue(textPoint); }