Exemplo n.º 1
0
 private void _RecycleGameObject(GameObject pooledGameObject, bool setIsInit)
 {
     if (pooledGameObject != null)
     {
         CPooledGameObjectScript component = pooledGameObject.GetComponent <CPooledGameObjectScript>();
         if (component != null)
         {
             Queue <CPooledGameObjectScript> queue = null;
             if (this.m_pooledGameObjectMap.TryGetValue(component.m_prefabKey, out queue))
             {
                 queue.Enqueue(component);
                 component.OnRecycle();
                 component.gameObject.transform.SetParent(this.m_poolRoot.transform, true);
                 component.m_isInit = setIsInit;
                 return;
             }
         }
         UnityEngine.Object.Destroy(pooledGameObject);
     }
 }