private void ReturnUI(AnimalNicknameUI ui)
 {
     if (Object.op_Equality((Object)ui, (Object)null) || this._uiPool.Contains(ui))
     {
         return;
     }
     ui.PlayFadeOut(this._fadeTime);
     this._uiPool.Add(ui);
 }
        private AnimalNicknameUI GetUI(INicknameObject elm)
        {
            AnimalNicknameUI animalNicknameUi = this._uiPool.PopFront <AnimalNicknameUI>();

            if (Object.op_Equality((Object)animalNicknameUi, (Object)null))
            {
                animalNicknameUi = (AnimalNicknameUI)((GameObject)Object.Instantiate <GameObject>((M0)this._prefab, ((Component)this).get_transform())).GetComponent <AnimalNicknameUI>();
            }
            animalNicknameUi.Nickname     = elm.Nickname;
            animalNicknameUi.TargetObject = elm.NicknameRoot;
            animalNicknameUi.TargetCamera = this._camera;
            animalNicknameUi.PlayFadeIn(this._fadeTime);
            return(animalNicknameUi);
        }
        private void Rename(INicknameObject elm)
        {
            ValueTuple <INicknameObject, AnimalNicknameUI> valueTuple;

            if (elm == null || !this._showTable.TryGetValue(elm.InstanceID, out valueTuple))
            {
                return;
            }
            AnimalNicknameUI animalNicknameUi = (AnimalNicknameUI)valueTuple.Item2;

            if (!Object.op_Inequality((Object)animalNicknameUi, (Object)null))
            {
                return;
            }
            animalNicknameUi.Nickname = elm.Nickname;
        }
        private void OnUpdate()
        {
            List <INicknameObject> toRelease1 = ListPool <INicknameObject> .Get();

            List <INicknameObject> toRelease2 = ListPool <INicknameObject> .Get();

            for (int index = 0; index < this._hideList.Count; ++index)
            {
                INicknameObject hide = this._hideList[index];
                if (hide == null)
                {
                    this._hideList.RemoveAt(index);
                    --index;
                }
                else if (this.ShowState(hide))
                {
                    toRelease2.Add(hide);
                    this._hideList.RemoveAt(index);
                    --index;
                }
            }
            for (int index = 0; index < this._showList.Count; ++index)
            {
                INicknameObject show = this._showList[index];
                if (show == null)
                {
                    this._showList.RemoveAt(index);
                    --index;
                }
                else if (this.HideState(show))
                {
                    toRelease1.Add(show);
                    this._showList.RemoveAt(index);
                    --index;
                }
            }
            for (int index = 0; index < toRelease2.Count; ++index)
            {
                INicknameObject  elm = toRelease2[index];
                AnimalNicknameUI ui  = this.GetUI(elm);
                this._showTable[elm.InstanceID] = new ValueTuple <INicknameObject, AnimalNicknameUI>(elm, ui);
            }
            if (!((IReadOnlyList <INicknameObject>)toRelease2).IsNullOrEmpty <INicknameObject>())
            {
                this._showList.AddRange((IEnumerable <INicknameObject>)toRelease2);
            }
            for (int index = 0; index < toRelease1.Count; ++index)
            {
                int instanceId = toRelease1[index].InstanceID;
                ValueTuple <INicknameObject, AnimalNicknameUI> valueTuple;
                if (this._showTable.TryGetValue(instanceId, out valueTuple))
                {
                    this.ReturnUI((AnimalNicknameUI)valueTuple.Item2);
                    this._showTable.Remove(instanceId);
                }
            }
            if (!((IReadOnlyList <INicknameObject>)toRelease1).IsNullOrEmpty <INicknameObject>())
            {
                this._hideList.AddRange((IEnumerable <INicknameObject>)toRelease1);
            }
            ListPool <INicknameObject> .Release(toRelease1);

            ListPool <INicknameObject> .Release(toRelease2);
        }