Exemple #1
0
        private RemoveFx GetEffectGo(int id)
        {
            RemoveFx go = null;

            if (EffectDic[id].Count > 0)
            {
                go = EffectDic[id][0];
                EffectDic[id].RemoveAt(0);
            }
            else
            {
                go = InstantiateEffect(fxPrefabList[id]);
                go.Init(id);
            }

            return(go);
        }
Exemple #2
0
        private void Init()
        {
            EffectDic = new Dictionary <int, List <RemoveFx> >()
            {
            };
            for (int i = 0; i < fxPrefabList.Count; i++)
            {
                if (!EffectDic.ContainsKey(i))
                {
                    EffectDic.Add(i, new List <RemoveFx>());
                }

                for (int j = 0; j < 5; j++)
                {
                    RemoveFx fx = InstantiateEffect(fxPrefabList[i]);
                    fx.Init(i);
                    EffectDic[i].Add(fx);
                }
            }
        }