Ejemplo n.º 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));
                    }
                }
            }
        }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     foreach (Transform transformPool in poolObj)
     {
         pools.AddPool(transformPool);
     }
 }