| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | namespace DCL |
| | 4 | | { |
| | 5 | | public static class PoolManagerFactory |
| | 6 | | { |
| | 7 | | public const string EMPTY_GO_POOL_NAME = "Empty"; |
| | 8 | |
|
| | 9 | | public static void EnsureEntityPool(bool prewarm) // TODO: Move to PoolManagerFactory |
| | 10 | | { |
| 583 | 11 | | if (PoolManager.i.ContainsPool(EMPTY_GO_POOL_NAME)) |
| 286 | 12 | | return; |
| | 13 | |
|
| 297 | 14 | | GameObject go = new GameObject(); |
| 297 | 15 | | Pool pool = PoolManager.i.AddPool(EMPTY_GO_POOL_NAME, go, maxPrewarmCount: 1000, isPersistent: true); |
| | 16 | |
|
| 297 | 17 | | if (prewarm) |
| 0 | 18 | | pool.ForcePrewarm(); |
| 297 | 19 | | } |
| | 20 | | } |
| | 21 | | } |