public Effect AddEffect(EffectData data, Bullet bullet = null, Unit owner = null) { Effect effect = GetSameEffect(data); GameObject obj = effect == null?BoardManager.instance.effectPool.DequeueObjectPool() : null; if (!effect) { System.Type type = System.Type.GetType(string.Format("RogueNaraka.EffectScripts.{0}", data.type)); effect = obj.AddComponent(type) as Effect; List <Effect> list = dictionary[data.type]; effects.Add(effect); effect.Init((EffectData)data.Clone(), list, unit, bullet, owner); } else { effect.Combine(data); } return(effect); }