private void ReturnElement(NotifyMessageElement _elm)
 {
     if (((Component)_elm).get_gameObject().get_activeSelf())
     {
         ((Component)_elm).get_gameObject().SetActive(false);
     }
     if (this.openElements.Contains(_elm))
     {
         this.openElements.Remove(_elm);
     }
     if (this.closeElements.Contains(_elm))
     {
         return;
     }
     this.closeElements.Add(_elm);
 }
        private void PopupLog()
        {
            string str = this.messageStock.Pop <string>();
            NotifyMessageElement element = this.GetElement();

            if (Object.op_Equality((Object)element, (Object)null))
            {
                return;
            }
            element.SetTime(this.fadeInTime, this.displayTime, this.fadeOutTime);
            element.SetAlpha(this.startAlpha, this.endAlpha);
            element.LocalPosition          = Vector3.get_zero();
            element.MessageText            = str;
            element.MessageColor           = (Color)this.whiteColor;
            element.SpeechBubbleIconActive = true;
            if (!((Component)element).get_gameObject().get_activeSelf())
            {
                ((Component)element).get_gameObject().SetActive(true);
            }
            ((Component)element).get_transform().SetAsLastSibling();
            element.StartFadeIn(this.popupWidth);
            float _posY = 0.0f;

            for (int index = 0; index < this.openElements.Count; ++index)
            {
                NotifyMessageElement openElement = this.openElements[index];
                if (Object.op_Equality((Object)openElement, (Object)null))
                {
                    this.openElements.RemoveAt(index);
                    --index;
                }
                else
                {
                    openElement.SpeechBubbleIconActive = false;
                    _posY += this.popupHeight;
                    if (index <= this.displayMaxElement - 2)
                    {
                        openElement.StartSlidUp(_posY);
                    }
                    else if (!openElement.PlayingFadeOut)
                    {
                        openElement.StartFadeOut();
                    }
                }
            }
            this.openElements.Insert(0, element);
        }
        private NotifyMessageElement GetElement()
        {
            NotifyMessageElement notifyMessageElement = !this.closeElements.IsNullOrEmpty <NotifyMessageElement>() ? this.closeElements.Pop <NotifyMessageElement>() : (NotifyMessageElement)null;

            if (Object.op_Equality((Object)notifyMessageElement, (Object)null))
            {
                notifyMessageElement = (NotifyMessageElement)((GameObject)Object.Instantiate <GameObject>((M0)this.Prefab, ((Component)this).get_transform(), false))?.GetComponent <NotifyMessageElement>();
                if (Object.op_Equality((Object)notifyMessageElement, (Object)null))
                {
                    return((NotifyMessageElement)null);
                }
                ((Object)((Component)notifyMessageElement).get_gameObject()).set_name(string.Format("{0}_{1}", (object)((Object)this.Prefab.get_gameObject()).get_name(), (object)this.elmCount++));
                notifyMessageElement.Root = this;
            }
            notifyMessageElement.EndActionEvent = new Action <NotifyMessageElement>(this.EndAction);
            return(notifyMessageElement);
        }
 private void EndAction(NotifyMessageElement _elm)
 {
     _elm.EndActionEvent = (Action <NotifyMessageElement>)null;
     this.ReturnElement(_elm);
 }