Exemplo n.º 1
0
 public GameObject instantiate()
 {
     if (pool == null)
     {
         count++;
         pool = new Object_pool(this.gameObject);
         Debug.Log(string.Format("amount of prefabs with pooled Component '{0}' = {1}", this, count));
     }
     return(pool.get());
 }
Exemplo n.º 2
0
        private GameObject get_from_pool()
        {
            if (pool == null)
            {
                count++;
                pool = new Object_pool(this.gameObject);
                Debug.Log(string.Format("amount of prefabs with pooled Component '{0}' = {1}", this, count));
            }
            GameObject game_object = pool.get();

            return(game_object);
        }