Beispiel #1
0
    //TODO: should delete it when refactor done!
    private void PushDialog(GameObject go, GameObject sender = null, bool instant = true)
    {
        try {
            AdjustPanelDepth(go);

            if (dialogQueue.Count > 0)
            {
                DialogBase curDb = dialogQueue.Peek().GetComponent <DialogBase>();
                if (curDb != null && go.GetComponent <DialogBase>().style == DialogStyle.NormalDialog)
                {
                    curDb.OnPause();
                }
            }

            DialogBase newDb = go.GetComponent <DialogBase>();
            if (newDb != null)
            {
                if (sender != null)
                {
                    newDb.Init(sender, null);
                }
//				newDb.OnResume();
                if (newDb.IsFullScreen() && mainNode != null)
                {
//					mainNode.SetActive(false);
                }
            }
        } catch (Exception e) {
            Debug.LogError(e);
        }

        dialogQueue.Push(go);

//		PlayOpenDialogAnimation(go, instant);

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