// TODO aherrera : second param: ePopupType? public void AddPopup(PopupModel.sPopupInfos popup_infos) { GameObject new_popup_go = Instantiate(PopupDefaultPrefab); PopupModel popup_model = new_popup_go.GetComponent <PopupModel>(); if (popup_model == null) { popup_model = new_popup_go.AddComponent <PopupModel>(); } PopupView view = new_popup_go.GetComponent <PopupView>(); if (view == null) { view = new_popup_go.gameObject.AddComponent <PopupView>(); } // TODO aherrera : IF you're gonna do enums and default popups, use popup_infos to setup the popup HERE // probably to the popup_model AddPopup(new_popup_go); popup_model.InitializePopup(); // view.Initialize? UpdatePopupInput(); }
public void PopupPooper() { PopupModel.sPopupInfos popup_params = new PopupModel.sPopupInfos(); popup_params.title = "Poop Popup"; popup_params.content = "Toilet humor"; // IF(when) I want to add a callback, I'd do it here. To some method in the DungeonController. PopupController.instance.AddPopup(popup_params); }