public BasePopup BuildPopup(Transform parent, string title, string descript, string btnText, PopupsID popupId = PopupsID.BasePopup, bool isPause = false) { if (popupPrefabs.All(i => i.popupId != popupId)) { return(null); } if (isPause && _isPauseActivated) { return(null); } else if (isPause) { _isPauseActivated = true; } CreateBlackOverlay(parent); var popup = Instantiate <BasePopup>(popupPrefabs.FirstOrDefault(i => i.popupId == popupId), parent); popup.title.text = title.ToUpper(); popup.description.text = descript.ToUpper(); //popup.GetComponent<Animator>().SetFloat("EntryAnim", GetRandomAnimation()); popup.isShowing = true; if (popup.okButton != null) { popup.okButton.GetComponentInChildren <Text>().text = btnText.ToUpper(); } popup.AddFunction(BasePopup.FunctionTypes.close, DisplayedPopupWasClosed); _popupStack++; return(popup); }
public BasePopup BuildPopup(Transform parent, string title, string descript, string btnText1, string btnText2, string btnText3, PopupsID popupId = PopupsID.BasePopup, bool isPause = false) { var popup = BuildPopup(parent, title, descript, btnText1, btnText2, popupId, isPause); if (popup == null) { return(null); } if (popup is EndLevelPopup) { (popup as EndLevelPopup).retryButton.GetComponentInChildren <Text>().text = btnText3; } return(popup); }
public BasePopup BuildPopup(Transform parent, string title, string descript, string btnText, PopupsID popupId = PopupsID.BasePopup) { if (popupPrefabs.All(i => i.popupId != popupId)) { return(null); } var popup = Instantiate <BasePopup>(popupPrefabs.FirstOrDefault(i => i.popupId == popupId), parent); popup.title.text = title.ToUpper(); popup.description.text = descript.ToUpper(); popup.GetComponent <Animator>().SetFloat("EntryAnim", GetRandomAnimation()); popup.isShowing = true; if (popup.okButton != null) { popup.okButton.GetComponentInChildren <Text>().text = btnText.ToUpper(); } return(popup); }