public static PopoutController CreatePopoutUnitSpeak(string unitName, string message , string unitImageAddress , int sortingoder , bool dismissAfterTapBtn, PopoutWIndowAlertType type , Action <PopoutController, PopoutWindowAlertActionType> action = null) { string name = popoutPrefabName; UnityEngine.Object prefab = null; name = "Windows/PopoutUnitSpeak"; if (popoutMessage == null) { Debug.Log("Loading popout file " + name); popoutMessage = Resources.Load(name); DontDestroyOnLoad(popoutMessage); } prefab = popoutMessage; GameObject tf = Instantiate(prefab) as GameObject; //tf.transform.position = pos; PopoutController pop = tf.GetComponent <PopoutController>(); pop.Setup(unitName, message, sortingoder, dismissAfterTapBtn, type, action); pop.panelBgImg1.sprite = Resources.Load <Sprite>(unitImageAddress); pop.fadeEndScale = Vector3.zero; return(pop); }
public void SetupMsgFlow(string title, string message, int sortingoder, bool dismissAfterTapBtn , PopoutWIndowAlertType type, Action <PopoutController, PopoutWindowAlertActionType> action) { _title = title; _message = message; _type = type; _action = action; titleText.text = _title; messageText.text = _message; ShowMsgFlow(sortingoder); }
public void refreshBtnsInPanel(PopoutWIndowAlertType currentType) { if (currentType == PopoutWIndowAlertType.ConfirmMessage) { confirmBtn.gameObject.SetActive(true); cancelBtn.gameObject.SetActive(false); } else if (currentType == PopoutWIndowAlertType.ConfirmOrCancel) { confirmBtn.gameObject.SetActive(true); cancelBtn.gameObject.SetActive(true); } else if (currentType == PopoutWIndowAlertType.MessageDismissWithDelay) { confirmBtn.gameObject.SetActive(false); cancelBtn.gameObject.SetActive(false); } }
public static PopoutController CreatePopoutAlert(string title, string message, int sortingoder , bool dismissAfterTapBtn, PopoutWIndowAlertType type , Action <PopoutController, PopoutWindowAlertActionType> action = null , string style = "") { string name = popoutPrefabName; UnityEngine.Object prefab = null; if (style == "con") { name = "Windows/PopoutConfirmCon"; if (popout1 == null) { Debug.Log("Loading popout file " + name); popout1 = Resources.Load(name); DontDestroyOnLoad(popout1); } prefab = popout1; } else { if (popout0 == null) { Debug.Log("Loading popout file " + name); popout0 = Resources.Load(name); DontDestroyOnLoad(popout0); } prefab = popout0; } Debug.Log("Loading file " + name); GameObject tf = Instantiate(prefab) as GameObject; PopoutController pop = tf.GetComponent <PopoutController>(); pop.Setup(title, message, sortingoder, dismissAfterTapBtn, type, action); //SDGameManager.Instance.audio return(pop); }