示例#1
0
    public void ShowMessage(string msg, float time = 1.5f)
    {
        AToast aToast = new AToast(msg, time);

        queue.Enqueue(aToast);

        ShowOldestToast();
    }
示例#2
0
 private void Show(AToast aToast)
 {
     SetMessage(aToast.msg);
     SetEnabled(true);
     GetComponent <Animator>().SetBool("show", true);
     Invoke("Hide", aToast.time);
     isShowing = true;
 }
示例#3
0
    public void ShowMessage(string msg, float duration = 2f)
    {
        AToast aToast = new AToast(msg, duration);

        queue.Enqueue(aToast);

        ShowOldestToast();
    }
示例#4
0
 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;
 }
示例#5
0
    private void ShowOldestToast()
    {
        if (queue.Count == 0)
        {
            return;
        }
        if (isShowing)
        {
            return;
        }

        AToast current = queue.Dequeue();

        Show(current);
    }
示例#6
0
    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);
    }