Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class InitialPool : MonoBehaviour
- {
- [System.Serializable]
- public class Item
- {
- public int initialCount = 1;
- public GameObject prefab;
- }
- public List<Item> initialObjects;
- private void Awake()
- {
- Context.pool.SetParentObject(gameObject);
- foreach (var item in initialObjects)
- {
- Context.pool.Create(item.prefab, item.initialCount);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment