Ejemplo n.º 1
0
        /// <summary> Hides the CurrentVisibleQueuePopup (if visible) and clears the PopupQueue </summary>
        /// <param name="instantAction"> Should the CurrentVisibleQueuePopup (if visible) be hidden instantly? (animate in zero seconds) </param>
        public static void ClearQueue(bool instantAction = false)
        {
            if (CurrentVisibleQueuePopup != null)
            {
                CurrentVisibleQueuePopup.Hide(instantAction);
            }
            if (QueueIsEmpty)
            {
                return;
            }
            foreach (UIPopupQueueData data in PopupQueue)
            {
                if (data.Popup == null)
                {
                    continue;
                }
                if (data.Popup == CurrentVisibleQueuePopup)
                {
                    continue;
                }
                data.Popup.Hide(instantAction);
                data.Popup.AddedToQueue = false;
            }

            PopupQueue.Clear();
            if (Instance.DebugComponent)
            {
                DDebug.Log("PopupQueue Cleared", Instance);
            }
        }