ExplosionViewResolver(
     IPoolManager poolManager,
     IEventSystem eventSystem,
     IInstantiator instantiator
     ) : base(
         poolManager,
         eventSystem,
         instantiator
         )
 {
     ViewPool.PreAllocate(20);
 }
Esempio n. 2
0
        public HitScoreViewResolver(
            IPoolManager poolManager,
            IEventSystem eventSystem,
            IInstantiator instantiator
            ) : base(
                poolManager,
                eventSystem,
                instantiator
                )
        {
            _canvas = GameObject.Find("Canvas");

            ViewPool.PreAllocate(10);
        }
Esempio n. 3
0
        public void should_pre_allocate_views()
        {
            var mockViewHandler = Substitute.For <IViewHandler>();

            mockViewHandler.CreateView().Returns(null);

            var pool = new ViewPool(5, mockViewHandler);

            pool.PreAllocate(20);

            mockViewHandler.Received(20).CreateView();
            Assert.Equal(20, pool.PooledObjects.Count);
            Assert.All(pool.PooledObjects, x => Assert.False(x.IsInUse));
            Assert.All(pool.PooledObjects, x => Assert.Null(x.ViewObject));
        }
 public SelfDestructionViewResolver(IPoolManager poolManager, IEventSystem eventSystem)
     : base(poolManager, eventSystem)
 {
     ViewPool.PreAllocate(20);
 }
Esempio n. 5
0
 protected override void OnPoolStarting()
 {
     ViewPool.PreAllocate(30);
 }