예제 #1
0
    public void TryCloseDialog(BaseDialog _dialog)
    {
        if (_dialog != null)
        {
            if (activeDialog != null)
            {
                if (_dialog == activeDialog)
                {
                    activeDialog = PopDialog();
                    if (activeDialog != null)
                    {
                        activeDialog.dialogFrame.gameObject.SetActive(false);
                    }

                    _dialog.dialogFrame.Hide(() => {
                        GameObjectHelper.Destroy(_dialog.dialogFrame.gameObject, 0.25f);
                        if (activeDialog != null)
                        {
                            activeDialog.dialogFrame.Show();
                        }
                    });

                    SetDirty();
                }
                else
                {
                    LogHelper.LogError("Cannot close dialog "
                                       + _dialog.GetType()
                                       + " "
                                       + _dialog.name
                                       + "; "
                                       + nameof(activeDialog)
                                       + " and "
                                       + nameof(_dialog)
                                       + " are not the same",
                                       this
                                       );
                }
            }
            else
            {
                LogHelper.LogError("Cannot close dialog "
                                   + _dialog.GetType().Name
                                   + " "
                                   + _dialog.name
                                   + "; "
                                   + nameof(activeDialog)
                                   + " is not set",
                                   this
                                   );
            }
        }
    }
예제 #2
0
    private void DisplayBaseDialog(string _label, BaseDialog _dialog)
    {
        if (_dialog != null)
        {
            _label = string.Format("{0} : {1} ({2})",
                                   _label,
                                   _dialog.name,
                                   _dialog.GetType().Name
                                   );
        }

        EditorGUILayout.LabelField(_label);
    }