protected void Awake() { if (Instance != null) { Destroy(gameObject); return; } Instance = this; DontDestroyOnLoad(gameObject); //init pools pools = new Dictionary <string, List <PoolManager> >(); foreach (VFXDataHolder dataHolder in data) { foreach (VfxData vfxData in dataHolder.list) { if (!pools.ContainsKey(vfxData.id)) { pools.Add(vfxData.id, new List <PoolManager>()); } foreach (Vfx vfx in vfxData.vfxs) { pools[vfxData.id].Add(Pools.AddPool(vfx, transform)); } } } }
public void Initialize(VfxHolder holder) { this.holder = holder; gameObject.SetActive(false); }