Exemple #1
0
 void HideGo(GameObject _Go)
 {
     if (this._dicGoSurviveTimer.ContainsKey(_Go))
     {
         this._dicGoSurviveTimer.Remove(_Go);
     }
     if (this._isAutoHide)
     {
         PoolGoAutoHide autoHide = _Go.GetComponent <PoolGoAutoHide>();
         if (autoHide != null)
         {
             autoHide.EndAutoHide();
         }
     }
     if (_Go == null)
     {
         return;
     }
     _Go.SetActive(false);
     this._falseListGo.Add(_Go);
     if (this._trueListGo.Contains(_Go))
     {
         this._trueListGo.Remove(_Go);
     }
 }
Exemple #2
0
        /// <summary>
        /// 显示物体
        /// </summary>
        /// <param name="_Go"></param>
        void ShowGo(GameObject _Go)
        {
            if (this._goList == null)
            {
                this._goList = new List <GameObject> ();
            }
            if (0 < this._goList.Count)
            {
                this._goList.Clear();
            }


            if (this._dicGoSurviveTimer.ContainsKey(_Go))
            {
                this._dicGoSurviveTimer [_Go] = 0;
                foreach (var temp in this._dicGoSurviveTimer)
                {
                    if (temp.Key != _Go)
                    {
                        this._goList.Add(temp.Key);
                    }
                }
                int lentj = this._goList.Count;
                for (int i = 0; i < lentj; i++)
                {
                    this._dicGoSurviveTimer [this._goList [i]] += 1;
                }
            }
            else
            {
                this._dicGoSurviveTimer.Add(_Go, 0);
                foreach (var temp in this._dicGoSurviveTimer)
                {
                    if (temp.Key != _Go)
                    {
                        this._goList.Add(temp.Key);
                    }
                }
                int lentj = this._goList.Count;

                for (int i = 0; i < lentj; i++)
                {
                    this._dicGoSurviveTimer [this._goList [i]] += 1;
                }
            }
            if (this._isAutoHide)
            {
                PoolGoAutoHide autoHide = _Go.GetComponent <PoolGoAutoHide>();
                if (autoHide == null)
                {
                    autoHide = _Go.AddComponent <PoolGoAutoHide>();
                }
                autoHide.StartAutoHide(this._goName, this._autoHideTimer);
            }
            _Go.SetActive(true);
            if (!this._trueListGo.Contains(_Go))
            {
                this._trueListGo.Add(_Go);
            }
            if (this._falseListGo.Contains(_Go))
            {
                this._falseListGo.Remove(_Go);
            }
        }