public override void SetParams(string text, string caption, UIMessageBox.OnClickCallback callback, params object[] args)
    {
        base.SetParams(text, caption, callback, args);

        if (args.Length > 0)
        {
            SetButtonColorScheme((MBButtonColorScheme)args[0]);
        }
        else
        {
            SetButtonColorScheme(MBButtonColorScheme.red_green);
        }
    }
    public void ShowErrorMessageBox(int errorCode, string uiNow)
    {
        if (GameManager.Instance.GameState == EnumGameState.InTown ||
            GameManager.Instance.GameState == EnumGameState.InBattle && (errorCode == 5003 || errorCode == 5004))
        {
            _errorCode = errorCode;

            _uiToClose = uiNow;

            string rightButtonText = null;

            switch (_errorCode)
            {
            case 5001:                     //buy hc
                rightButtonText = "IDS_BUTTON_GLOBAL_BUY";
                break;

            case 5002:                     //buy sc
                rightButtonText = "IDS_BUTTON_GLOBAL_EXCHANGE";
                break;

            case 5003:                     //expand bag
                rightButtonText = "IDS_TITLE_INVENTORYADDSPACE";
                break;

            case 5004:                     //buy vitality
                rightButtonText = "IDS_BUTTON_GLOBAL_BUY";
                break;
            }            //end switch

            this.ShowMessageBox(Utils.GetErrorIDS(errorCode), null,
                                "IDS_BUTTON_GLOBAL_BACK",
                                rightButtonText,
                                MB_TYPE.MB_OKCANCEL, OnErrorMessageboxChoice);
        }
        else
        {
            UIMessageBox.OnClickCallback callback = null;

            if (errorCode == 7001 || errorCode == 7003 || errorCode == 7004)
            {
                callback = OnFatalError;
            }

            this.ShowMessageBox(Utils.GetErrorIDS(errorCode), null, MB_TYPE.MB_OK, callback);
        }
    }
    public GameObject ShowMessageBox(string text, string caption, string leftStrIDS, string rightStrIDS, MB_TYPE type, UIMessageBox.OnClickCallback clickCallback, params System.Object[] args)
    {
        GameObject messageBox;

        GameObject parent = MessageBoxCamera.Instance.uiCamera.gameObject;

        switch (type)
        {
        case MB_TYPE.MB_OK:
            messageBox = NGUITools.AddChild(parent, mbOKPrefab);
            messageBox.GetComponent <UIMessageBox>().LocalizeButtonText(leftStrIDS, null);
            break;

        case MB_TYPE.MB_OK_WITH_ITEMS:
            messageBox = NGUITools.AddChild(parent, mbOKWithItemsPrefab);
            messageBox.GetComponent <UIMessageBox>().LocalizeButtonText(leftStrIDS, null);
            break;

        case MB_TYPE.MB_WAITING_DELAY:
            messageBox = NGUITools.AddChild(parent, mbWaitingDelayPrefab);
            break;

        case MB_TYPE.MB_OKCANCEL:
            messageBox = NGUITools.AddChild(parent, mbOKCancelPrefab);
            messageBox.GetComponent <UIMessageBox>().LocalizeButtonText(leftStrIDS, rightStrIDS);
            break;

        case MB_TYPE.MB_WAITING:
            messageBox = NGUITools.AddChild(parent, mbWaitingPrefab);
            break;

        case MB_TYPE.MB_INPUT:
            messageBox = NGUITools.AddChild(parent, mbInputPrefab);
            break;

        case MB_TYPE.MB_FLOATING:
            //check singletons
            if (_singletonMessageboxMapping.ContainsKey(MB_TYPE.MB_FLOATING))
            {
                messageBox = _singletonMessageboxMapping[MB_TYPE.MB_FLOATING];

                if (!messageBox.activeSelf)
                {
                    messageBox.SetActive(true);
                }
            }
            else
            {
                messageBox = NGUITools.AddChild(parent, mbFloatingPrefab);
                _singletonMessageboxMapping.Add(MB_TYPE.MB_FLOATING, messageBox);
            }
            break;

        default:
            messageBox = null;
            Assertion.Check(false);
            break;
        }         //end switch

        if (!_singletonMessageboxMapping.ContainsKey(type))
        {
            _messageBoxList.Add(messageBox);
        }

        int layer = _messageBoxList.Count;

        if (type == MB_TYPE.MB_FLOATING)
        {
            layer += _singletonMessageboxMapping.Count;
        }

        messageBox.transform.localPosition = Vector3.back * layer * 5;

        UIMessageBox messageboxScript = messageBox.GetComponent <UIMessageBox>();

        messageboxScript.SetParams(text, caption, clickCallback, args);

        return(messageBox);
    }
 public GameObject ShowMessageBox(string text, string caption, MB_TYPE type, UIMessageBox.OnClickCallback clickCallback, params System.Object[] args)
 {
     return(ShowMessageBox(text, caption, null, null, type, clickCallback, args));
 }