/// <summary> /// Set UI /// </summary> /// <param name="aData"> Queued Popup data </param> private void ShowUI(QueuedPopUpData aData) { mCurrentCard = aData; // Fill Data in UI UIPopup tPop = _instance.GetPopupGO(); tPop.m_HeadingText.text = aData.HeadingMessage; tPop.m_MessageText.text = aData.DescriptionMessage; tPop.m_WarningText.text = aData.WarningMessage; tPop.m_OKButtonText.text = aData.OkButtonLabel; tPop.m_RightButtonText.text = aData.RightButtonLabel; tPop.m_LeftButtonText.text = aData.LeftButtonLable; buttonCallback = aData.callback; // Button Activation bool tValue = string.IsNullOrEmpty(aData.OkButtonLabel); tPop._OkButton.gameObject.SetActive(!tValue); tPop._RightButton.gameObject.SetActive(tValue); tPop._LeftButton.gameObject.SetActive(tValue); tPop._CrossButton.gameObject.SetActive(aData.CrossAllowed); m_GenericPopup.gameObject.SetActive(true); //Play Popup UI tween animation Utils.PlayAnimation(m_GenericPopup.m_RootGameObject, m_GenericPopup.gameObject.GetComponent <Image>(), true); }
/// <summary> /// Store current popup data /// Enque current popup /// </summary> /// <param name="aTitle"> Title Lable</param> /// <param name="aMessage"> Message Lable</param> /// <param name="aWarningText"> Warning Lable</param> /// <param name="aOkButtontext"> OK button Lable</param> /// <param name="aLeftButtontext"> Left button Lable</param> /// <param name="aRightButtontext"> Right button Lable</param> /// <param name="aCross"> Cross button refernce</param> /// <param name="aCallback"> Button Listner</param> private void StoreData(string aTitle, string aMessage, string aWarningText, string aOkButtontext, string aLeftButtontext, string aRightButtontext, bool aCross, Action <PopUpButtonCallback> aCallback) { QueuedPopUpData tData = new QueuedPopUpData { HeadingMessage = aTitle, DescriptionMessage = aMessage, WarningMessage = aWarningText, callback = aCallback, CrossAllowed = aCross, OkButtonLabel = aOkButtontext, LeftButtonLable = aLeftButtontext, RightButtonLabel = aRightButtontext, IsAutoClose = true }; m_PopUpQueud.Enqueue(tData); ShowUI(tData); }