public void ShowMessage(string message, Color color) { PopupMessageVisual visual = null; while (mInactiveVisuals.Count > 0) { visual = mInactiveVisuals.Pop(); if (visual != null) { break; } } if (visual == null) { visual = Instantiate(Prefab, transform); } visual.BeginAnimating(message, color); }
public void AddInactiveVisual(PopupMessageVisual visual) { visual.gameObject.SetActive(false); mInactiveVisuals.Push(visual); }