public void SetPopUpData(PopUpBannerData popUpBannerData, PopUpBannerAction popUpBannerAction, bool autoClose = false)
    {
        txtTitle.text       = popUpBannerData.title;
        txtDescription.text = popUpBannerData.description;

        if (autoClose)
        {
            btnCancel.gameObject.SetActive(false);
            btnAccept.gameObject.SetActive(false);
            this.autoClose = autoClose;
            return;
        }

        if (popUpBannerAction.OnCancelButtonPress == null)
        {
            btnCancel.gameObject.SetActive(false);
        }
        else
        {
            btnCancel.onClick.AddListener(popUpBannerAction.OnCancelButtonPress);
        }

        if (popUpBannerAction.OnAcceptButtonPress != null)
        {
            btnAccept.onClick.AddListener(popUpBannerAction.OnAcceptButtonPress);
        }
    }
示例#2
0
    public void GeneratePopUpBanner(string title, string description, UnityAction OnCancel, UnityAction OnConfirm)
    {
        PopUpBannerData   popBD = new PopUpBannerData(title, description);
        PopUpBannerAction popBA = new PopUpBannerAction(OnCancel, OnConfirm);

        uIPopUpBanner = CreatePopUpBanner();
        uIPopUpBanner.SetPopUpData(popBD, popBA);
        uIPopUpBanner.Show();
    }