Exemplo n.º 1
0
            private void OnPoolCompleted()
            {
                _gameObject = _pool.Instantiate();
                if (_callbacks == null)
                {
                    return;
                }
                var shadows = _callbacks;
                var count   = shadows.Count;

                if (count > 0)
                {
                    _callbacks = null;
                    for (var i = 0; i < count; i++)
                    {
                        var cb = shadows[i];
                        try
                        {
                            cb();
                        }
                        catch (Exception exception)
                        {
                            UnityEngine.Debug.LogErrorFormat("Handle({0}) Exception: {1}", _pool.assetPath, exception);
                        }
                    }
                }
            }
Exemplo n.º 2
0
 public Handle(PrefabPool pool)
 {
     _pool       = pool;
     _gameObject = _pool != null?_pool.Instantiate() : null;
 }