static void AddBuff(int buffId, GameObject o) { var buffC = BuffConfig.Get(buffId); var type = CONSTANT.CONST.BUFF_PERFIX + Enum.GetName(typeof(ENUM_EFFECT), buffC.EffectType); var buff = o.AddComponent(Type.GetType(type)) as Buff; buff.BuffId = buffId; }
protected void Start() { config = BuffConfig.Get(BuffId); lifeTime = config.Duration / 1000f; delay = config.Delay / 1000f; period = config.Period / 1000f; ppt = GetComponent <Property>(); }