public void ShowMessage(string msg, float time = 1.5f) { AToast aToast = new AToast(msg, time); queue.Enqueue(aToast); ShowOldestToast(); }
private void Show(AToast aToast) { SetMessage(aToast.msg); SetEnabled(true); GetComponent <Animator>().SetBool("show", true); Invoke("Hide", aToast.time); isShowing = true; }
public void ShowMessage(string msg, float duration = 2f) { AToast aToast = new AToast(msg, duration); queue.Enqueue(aToast); ShowOldestToast(); }
private void Show(AToast aToast) { CUtils.GetChildren(transform).ForEach(x => x.gameObject.SetActive(true)); SetMessage(aToast.msg); GetComponent <Animator>().SetBool("show", true); Invoke("Hide", aToast.duration); isShowing = true; }
private void ShowOldestToast() { if (queue.Count == 0) { return; } if (isShowing) { return; } AToast current = queue.Dequeue(); Show(current); }
private void ShowOldestToast() { if (queue.Count == 0) { return; } if (isShowing) { return; } AToast current = queue.Dequeue(); if (current.requestTime < Time.time - 2) { ShowOldestToast(); return; } Show(current); }