Guest User

Untitled

a guest
Aug 17th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class InitialPool : MonoBehaviour
  6. {
  7.     [System.Serializable]
  8.     public class Item
  9.     {
  10.         public int initialCount = 1;
  11.         public GameObject prefab;
  12.     }
  13.  
  14.  
  15.     public List<Item> initialObjects;
  16.  
  17.  
  18.     private void Awake()
  19.     {
  20.         Context.pool.SetParentObject(gameObject);
  21.  
  22.         foreach (var item in initialObjects)
  23.         {
  24.             Context.pool.Create(item.prefab, item.initialCount);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment