Example #1
0
        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));
                    }
                }
            }
        }
Example #2
0
        public void Initialize(VfxHolder holder)
        {
            this.holder = holder;

            gameObject.SetActive(false);
        }