Ejemplo n.º 1
0
 public void Bless(Unit mover)
 {
     foreach (Unit unit in Initiative.order)
     {
         if (RangeFinder.LineOfSight(owner, unit))
         {
             if (unit.unitInfo.faction == Factions.players && (unit.gameObject != gameObject))
             {
                 //check there are no effects of the same name.
                 if (unit.gameObject.GetComponent <Bless>() == null)
                 {
                     Bless bless = unit.gameObject.AddComponent <Bless>();
                     bless.AddEffect(gameObject);
                 }
                 else if (!unit.gameObject.GetComponent <Bless>().enabled)
                 {
                     unit.gameObject.GetComponent <Bless>().enabled = true;
                     unit.gameObject.GetComponent <Bless>().AddEffect(gameObject);
                 }
             }
         }
     }
 }