Beispiel #1
0
    public void CloseDialog()
    {
        if (dialogQueue.Count <= 0)
        {
            return;
        }

        GameObject  go            = dialogQueue.Pop();
        var         ds            = go.GetComponent <DialogBase>();
        DialogStyle goDialogStyle = ds == null ? DialogStyle.NormalDialog : ds.style;

//		AdjustPanelDepth(go, false);
        Debug.Log("close dialog " + go.name);
        PlayCloseDialogAnimation(go);

        if (dialogQueue.Count > 0)
        {
            DialogBase topDb = dialogQueue.Peek().GetComponent <DialogBase>();
            if (topDb != null && goDialogStyle == DialogStyle.NormalDialog)
            {
                topDb.OnResume();
            }
        }

        // check full screen dialog exist
        foreach (var item in dialogQueue)
        {
            if (item != null)
            {
                DialogBase dlg = item.GetComponent <DialogBase>();
                if (dlg != null && dlg.IsFullScreen())
                {
                    return;
                }
            }
        }
        if (mainNode != null && dialogQueue.Count == 0)           // no fullscreen dialog exist
        {
            mainNode.SetActive(true);
            if (middleNode != null)
            {
                middleNode.SetActive(true);
            }
        }

        if (dialogQueue.Count == 0)
        {
            currentMaxDepth = BASE_DEPTH;
        }

//		EventService.Instance.GetEvent<TutorialEvent>().Publish(SettingManager.Instance.TutorialSeq);
    }