示例#1
0
    public static GameObject MsgBox(
        string prefab
        , string message
        , PopupButtonMessageDelegate okDelegate
        , PopupButtonMessageDelegate retryDelegate
        , PopupButtonMessageDelegate cancelDelegate
        , TPOPUP popupType)
    {
        GameObject   go    = GameObject.Instantiate(Resources.Load(prefab) as GameObject) as GameObject;
        PopUpMessage popUp = go.GetComponent <PopUpMessage>();

        popUp.onOk     = okDelegate;
        popUp.onCancel = cancelDelegate;
        popUp.onRetry  = retryDelegate;

        popUp.textMesh.text     = message;
        popUp.textMesh.maxChars = message.Length;
        popUp.textMesh.Commit();

        popUp.popupType = popupType;
        popUp.InitializeButtons();

        PopupVisible = true;
        return(go);
    }
示例#2
0
 public static GameObject MsgBoxRetryCancel(string prefab, string message, PopupButtonMessageDelegate retryDelegate, PopupButtonMessageDelegate cancelDelegate)
 {
     return(MsgBox(prefab, message, null, retryDelegate, cancelDelegate, TPOPUP.BTN_RETRY_CANCEL));
 }
示例#3
0
 public static GameObject MsgBoxOkCancel(string prefab, string message, PopupButtonMessageDelegate okDelegate, PopupButtonMessageDelegate cancelDelegate)
 {
     return(MsgBox(prefab, message, okDelegate, null, cancelDelegate, TPOPUP.BTN_OK_CANCEL));
 }
示例#4
0
 public static GameObject MsgBoxOk(string prefab, string message, PopupButtonMessageDelegate okDelegate)
 {
     return(MsgBox(prefab, message, okDelegate, null, null, TPOPUP.BTN_OK));
 }