コード例 #1
0
ファイル: BaseDialog.cs プロジェクト: ToucanGamesLLC/uiStack
    public virtual void Populate(Options _options)
    {
        this.options = _options;

        if (_options != null)
        {
            m_onCloseDialog = _options.onCloseDialog;

            if (dialogFrame != null)
            {
                if (dialogFrame.closeButon != null)
                {
                    SetActive(dialogFrame.closeButon.gameObject, options.showCloseButton);
                }

                if (dialogFrame.titleText != null)
                {
                    SetText(dialogFrame.titleText, options.titleText);
                }
            }
        }
    }
コード例 #2
0
    public override void Populate(BaseDialog.Options _options)
    {
        base.Populate(_options);

        Options twoButtonOptions = _options as TwoButtonsDialog.Options;

        if (twoButtonOptions != null)
        {
            if (rightButton != null)
            {
                SetActive(rightButton.gameObject, twoButtonOptions.showRightButton);
                m_onRightButtonClick = twoButtonOptions.onRightButtonClick;
            }
            SetText(rightButtonText, twoButtonOptions.rightButtonText);

            if (leftButton != null)
            {
                SetActive(leftButton.gameObject, twoButtonOptions.showLeftButton);
                m_onLeftButtonClick = twoButtonOptions.onLeftButtonClick;
            }
            SetText(leftButtonText, twoButtonOptions.leftButtonText);

            SetText(messageText, twoButtonOptions.messageText);
        }
        else
        {
            LogHelper.LogWarning("Failed to populate "
                                 + GetType().Name
                                 + "; "
                                 + nameof(_options)
                                 + " is not of type "
                                 + typeof(TwoButtonsDialog.Options).Name,
                                 this
                                 );
        }
    }