Beispiel #1
0
        public void show(string str, MsgBox.ShowType type = ShowType.OK, MsgBox.CallBack callback = null, UI_LAYER layer = UI_LAYER.COMMON_UI, MsgBox.CancelCallBack cancelCallback = null)
        {
            if (_tip != null)
            {
                _tip.text = str;
            }
            if (string.IsNullOrEmpty(str))
            {
                TyCrashReport.reportException(new System.Exception(), "msgbox content is empty");
            }
            if (callback_ != null)
            {
                base.hide();
                _OpenAgain = true;
            }
            gameObject.SetActive(true);

            {
                gameObject.transform.localPosition = new Vector3(0, 0, -(int)layer);
            }

            UIPanel panel = GetComponent <UIPanel>();

            if (panel != null)
            {
                panel.depth = (int)layer;
            }
            setWinAnimIgnoreTimeScale(Time.timeScale != 1);//如果时间缩放不为1,则需要忽略缩放
            base.show();
            hideAll();
            callback_       = callback;
            _cancelCallBack = cancelCallback;
            if (type == ShowType.OK)
            {
                _goOK.SetActive(true);
            }
            else if (type == ShowType.YesCancel)
            {
                _goYesCancel.SetActive(true);
            }
        }
Beispiel #2
0
 public void show(string str)
 {
     gameObject.SetActive(true);
     _tip.text = str;
     gameObject.GetComponentInChildren <UISprite>().width = _tip.width + 24;
     TweenAlpha[] tpos = gameObject.GetComponentsInChildren <TweenAlpha>();
     for (int i = 0; i < tpos.Length; i++)
     {
         //tpos[i].Reset();
         tpos[i].ResetToBeginning();
         tpos[i].PlayForward();
     }
     try
     {
         if (str == null || str.Length < 3)
         {
             throw new System.Exception();
         }
     }
     catch (System.Exception e)
     {
         TyCrashReport.reportException(e, RG_Utils.getLanguageString("CodeItem142"));
     }
 }