コード例 #1
0
    protected override void OnOpen(object userData)
    {
        base.OnOpen(userData);

        DialogParams dialogParams = (DialogParams)userData;

        if (dialogParams == null)
        {
            Log.Warning("DialogParams is invalid.");
            return;
        }

        dialogMode = dialogParams.Mode;
        RefreshDialogMode();

        titleText.text   = dialogParams.Title;
        messageText.text = dialogParams.Message;

        pauseGame = dialogParams.PauseGame;
        RefreshPauseGame();

        userData = dialogParams.UserData;

        RefreshConfirmText(dialogParams.ConfirmText);
        onClickConfirm = dialogParams.OnClickConfirm;

        RefreshCancelText(dialogParams.CancelText);
        onClickCancel = dialogParams.OnClickCancel;

        RefreshOtherText(dialogParams.OtherText);
        onClickOther = dialogParams.OnClickOther;
    }
コード例 #2
0
    protected override void OnClose(object userData)
    {
        if (pauseGame)
        {
            GameEntry.Base.ResumeGame();
        }

        dialogMode       = DialogParams.DialogMode.单按钮;
        titleText.text   = string.Empty;
        messageText.text = string.Empty;
        pauseGame        = false;
        userData         = null;

        RefreshConfirmText(string.Empty);
        onClickConfirm = null;

        RefreshCancelText(string.Empty);
        onClickCancel = null;

        RefreshOtherText(string.Empty);
        onClickOther = null;

        base.OnClose(userData);
    }