示例#1
0
 static public void ReleaseEnemy(Enemy pEnemy)
 {
     if (pEnemy != null)
     {
         pEnemy.gameObject.SetActive(false);
         m_Recycler.Push(pEnemy);
     }
 }
示例#2
0
        public static void ReleaseView(EntityObject entity)
        {
            if (entity != null)
            {
                ViewObject obj = m_mapObject[entity];
                if (obj != null)
                {
                    if (EnableLog && Debuger.EnableLog)
                    {
                        Debuger.Log(LOG_TAG, "ReleaseView() {0}:{1} -> {2}:{3}",
                                    entity.GetType().Name, entity.GetHashCode(),
                                    obj.GetRecycleType(), obj.GetInstanceID());
                    }

                    m_mapObject.Remove(entity);
                    obj.ReleaseInFactory();
                    obj.gameObject.SetActive(false);

                    //将对象加入对象池
                    m_recycler.Push(obj);
                }
            }
        }