BorisKotlyar

Untitled

Jun 27th, 2024
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1.         public class Factory : PlaceholderFactory<CardViewCellProtocol, CardViewCell>
  2.         {
  3.         }
  4.  
  5.         public class Pool : MonoPoolableMemoryPool<CardViewCellProtocol, IMemoryPool, CardViewCell>
  6.         {
  7.         }
  8.  
  9.         public static void InitPool(DiContainer container)
  10.         {
  11.             container
  12.                 .BindFactory<CardViewCellProtocol, CardViewCell, Factory>()
  13.                 .FromPoolableMemoryPool<CardViewCellProtocol, CardViewCell, Pool>(poolBinder =>
  14.                     poolBinder
  15.                         .WithInitialSize(5)
  16.                         .FromComponentInNewPrefabResource($"Elements/{nameof(CardViewCell)}")
  17.                         .UnderTransformGroup(nameof(CardViewCell)));
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment