Пример #1
0
        public void RemoveMessageBox(int id, MessageBoxLevel boxLevel)
        {
            if (AllPopMsgBoxCache.ContainsKey(boxLevel) == false)
            {
                Debug.LogError("Can't Get This Type Of Box " + boxLevel + " id=" + id);
                return;
            }

            if (AllPopMsgBoxCache[boxLevel].Count == 0)
            {
                Debug.LogError("Can't Get This Type Of Box,There is No Record " + boxLevel + " id=" + id);
                return;
            }

            if (AllPopMsgBoxCache[boxLevel][0].BoxID != id)
            {
                Debug.LogError("The Wrong ID Of MSG " + AllPopMsgBoxCache[boxLevel][0].BoxID + "  ID" + id);
                return;
            }
            AllPopMsgBoxCache[boxLevel].RemoveAt(0); //Delete The First One
            --TotalBoxWaitingCot;
            IsShowingMsgBox  = false;
            CurShowingMsgBox = null;
            GetMessageBoxToShow(null);
        }
Пример #2
0
        /// <summary>
        /// Post Request To Dic And Select The Special One To Show
        /// </summary>
        /// <param name="request"></param>
        /// <param name="callBack"></param>
        public void ShowMessageBox(MessageBoxResquest request, MessageBoxCallback callBack)
        {
            if (request == null)
            {
                return;
            }
            MsgBox _box = new MsgBox(request, callBack);

            if (AllPopMsgBoxCache.ContainsKey(request.m_BoxLevel) == false)
            {
                AllPopMsgBoxCache[request.m_BoxLevel] = new List <MsgBox>();
            }

            //***TopLevel Msg Need TODO
            AllPopMsgBoxCache[request.m_BoxLevel].Add(_box);

            ++TotalBoxWaitingCot;
            ++BoxIDRecord; //Idetify One Box
            GetMessageBoxToShow(_box);
        }