Beispiel #1
0
        public PrefabPool GetPrefabPool(string assetPath, int capacity = 0)
        {
            if (_prefabPools == null)
            {
                _prefabPools = new Dictionary <string, PrefabPool>();
            }
            PrefabPool pool;

            if (!_prefabPools.TryGetValue(assetPath, out pool))
            {
                pool = _prefabPools[assetPath] = new PrefabPool(_root, assetPath, capacity);
            }
            return(pool);
        }
Beispiel #2
0
 public Handle(PrefabPool pool, GameObject gameObject)
 {
     _pool       = pool;
     _gameObject = gameObject;
 }
Beispiel #3
0
 public Handle(PrefabPool pool)
 {
     _pool       = pool;
     _gameObject = _pool != null?_pool.Instantiate() : null;
 }
Beispiel #4
0
 public Handle(PrefabPool pool)
 {
     _pool            = pool;
     _gameObject      = null;
     _pool.completed += OnPoolCompleted;
 }