예제 #1
0
    public void SystemTips(string msg, PanelSystemTips.MessageType msgType)
    {
        if (_systemTipsList == null)
        {
            _systemTipsList = new List <SystemTipsParam>();
        }

        PanelSystemTips systemTips = null;

        { // pool里空了,创建一个新的
            var go = Resources.Load("UI/Common/PanelSystemTips");
            if (go != null)
            {
                var go2 = Instantiate(go, transform) as GameObject;
                if (go2 != null)
                {
                    systemTips = go2.GetComponent <PanelSystemTips>();
                }
            }
            else
            {
                Debug.LogError("UI/PanelSystemTips not found!");
            }
        }

        if (systemTips != null)
        {
            if (_systemTipsPlaying)
            { // 当前动画正在播放,新增的动画就保存起来
                SystemTipsParam stp = new SystemTipsParam()
                {
                    _type = msgType,
                    _msg  = msg,
                    _tips = systemTips,
                };
                // 添加到播放链表
                _systemTipsList.Add(stp);
                systemTips.gameObject.SetActive(false);
            }
            else
            { // 否则直接播放
                systemTips.Show(msg, msgType, OnSystemTipsComplete);
                _systemTipsPlaying = true;
            }
        }
    }
예제 #2
0
 public void SystemTips(string msg, PanelSystemTips.MessageType msgType)
 {
     if (_systemTips == null)
     {
         var go = Resources.Load("UI/Common/PanelSystemTips");
         if (go != null)
         {
             var go2 = Instantiate(go, transform) as GameObject;
             if (go2 != null)
             {
                 _systemTips = go2.GetComponent <PanelSystemTips>();
             }
         }
         else
         {
             Debug.LogError("UI/PanelSystemTips not found!");
         }
     }
     if (_systemTips != null)
     {
         _systemTips.Show(msg, msgType);
     }
 }