Esempio n. 1
0
 public virtual void ApplyBuffsToRole(List <SkillAttachedBuff> buffDefs, Role role)
 {
     foreach (SkillAttachedBuff buffDef in buffDefs)
     {
         GameObject buffObj = Instantiate(buffDef.buffObj);
         if (buffDef.overrideExisting)
         {
             BaseBuff baseBuff = buffObj.GetComponent <BaseBuff>();
             baseBuff.duration  = buffDef.duration;
             baseBuff.frequency = buffDef.frequency;
             baseBuff.value     = buffDef.value;
             baseBuff.factor    = buffDef.factor;
         }
         role.AddBuff(buffObj, owner.GetComponent <Role>());
     }
 }