Beispiel #1
0
 public TData Add(TData buff, BaseUnit self, BaseUnit caster, TDBaseSkillData fromSkill)
 {
     MaxLayer = buff.MaxLayer > MaxLayer ? buff.MaxLayer : MaxLayer;
     if (MaxLayer <= 0)
     {
         return(null);
     }
     if (MaxLayer > Layer)
     {
         BuffList.Add(buff);
         buff.OnBeAdded(self, caster, fromSkill);
     }
     else
     {
         Remove(buff);
         BuffList.Add(buff);
         buff.OnBeAdded(self, caster, fromSkill);
     }
     return(buff);
 }
Beispiel #2
0
 public TData Add(TData buff, BaseUnit self)
 {
     MaxLayer = buff.MaxLayer > MaxLayer ? buff.MaxLayer : MaxLayer;
     if (MaxLayer <= 0)
     {
         return(null);
     }
     if (MaxLayer > Layer)
     {
         Buffs.Add(buff);
         buff.OnBeAdded(self);
     }
     else
     {
         Remove(buff);
         Buffs.Add(buff);
         buff.OnBeAdded(self);
     }
     return(buff);
 }