/* public SEffect Create(E_EffectType effect_type, int sub_type, string[] param, BaseEntity owner, Buff parent) * { * if (effect_type == 0) return null; * * int e_type = (int)effect_type; * EffCnf cnf = new EffCnf("", effect_type, sub_type, param); * * Dictionary<int, Type> effects; * _effect_map.TryGetValue(e_type, out effects); * if (effects == null) * { * EffectLog.Error("没有大类型为[{0}]的效果", e_type); * return null; * } * * Type type; * effects.TryGetValue(sub_type, out type); * if (type == null) * { * EffectLog.Error("没有大类型为[{0}],小类型为[{1}]的效果", e_type, sub_type); * return null; * } * SEffect effect = Activator.CreateInstance(type) as SEffect; * * if (effect != null) * effect.Init(cnf, owner, parent); * else * BuffLog.Log("找不到对应的效果" + effect_type); * return effect; * }*/ public BaseEffect Create(BaseBuff target_buff, EffectTemplateInfo info) { string type_name = "Summer.EffectAttribute"; Type type = Type.GetType(type_name); BaseEffect effect = Activator.CreateInstance(type) as BaseEffect; if (effect == null) { return(null); } effect.OnInit(target_buff._bid, info); return(effect); }
public virtual void OnDetach() { _info = null; _target_select = null; }
public virtual void OnInit(BuffId bid, EffectTemplateInfo info) { _info = info; _bid = bid; }