Exemple #1
0
 /// <summary>
 /// 创建Buff对象
 /// </summary>
 /// <param name="originer">Buff创建者(可以为空)</param>
 /// <param name="model">Buff配置数据</param>
 /// <param name="ower">Buff携带者</param>
 /// <param name="duration">持续时间</param>
 /// <param name="stack">Buff层数</param>
 /// <param name="permanent">是不是永久Buff</param>
 /// <param name="buffParam">Buff参数</param>
 public BuffObj(SkillCom originer, BuffModel model, SkillCom ower, float duration, int stack, bool permanent = false)
 {
     this.originer    = originer;
     this.model       = model;
     this.ower        = ower;
     this.duration    = duration;
     this.stack       = stack;
     this.isPermanent = permanent;
 }
        public bool GetBuffModel(string buffId, out BuffModel model)
        {
            if (buffModelCache.ContainsKey(buffId))
            {
                model = buffModelCache[buffId];
                return(true);
            }
            string jsonStr = LoadHelper.LoadString(SkillDef.GetBuffCnfName(buffId));

            if (string.IsNullOrEmpty(jsonStr))
            {
                model = default;
                return(false);
            }
            model = JsonMapper.ToObject <BuffModel>(jsonStr);
            buffModelCache.Add(buffId, model);
            return(true);
        }