示例#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());
 }
示例#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);
        }