예제 #1
0
    public bool Push(BaseDialog dialog)
    {
        if (dialog.Type == DialogType.Popup)
        {
            Debug.LogWarning("Cannot push popup into stack");
            return(false);
        }

        //get prelast
        BaseDialog preLast = null;

        if (stack.Count > 0)
        {
            preLast = stack.Peek();
        }

        //push
        dialog.Show();
        stack.Push(dialog);

        //check modal
        if (dialog.Type != DialogType.Modal && preLast != null)
        {
            preLast.Hide();
        }

        return(true);
    }
예제 #2
0
 public void Show()
 {
     dialog?.Show();
     OnShow?.Invoke();
 }