Ejemplo n.º 1
0
 private void Heal(IHpable hpable)
 {
     if (IsPlaced == true)
     {
         hpable.Hp.GiveHp(hpAdd, "Healing Station");
     }
 }
Ejemplo n.º 2
0
 private void TryBite(IHpable entity)
 {
     if (cooldown.Try())
     {
         entity.Hp.TakeHp(Dmg, "Rusher");
         audioSource.PlayOneShot(bite);
     }
 }
Ejemplo n.º 3
0
    protected override void OnTriggerEnter2D(Collider2D collision)
    {
        base.OnTriggerEnter2D(collision);
        IHpable entity;

        if (Check(collision, out entity))
        {
            bitter = entity;
        }
    }
Ejemplo n.º 4
0
 public static bool IsFromWrongTeam(this IHpable hpable, Collider2D colider, out Bullet bullet)
 {
     if ((bullet = colider.GetComponent <Bullet>()) != null)
     {
         return(bullet.Team != hpable.CurrentTeam);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 5
0
 protected override void OnTriggerExit2D(Collider2D collision)
 {
     base.OnTriggerExit2D(collision);
     if (Check(collision, out IHpable entity))
     {
         if (entity == bitter)
         {
             bitter = null;
         }
     }
 }
Ejemplo n.º 6
0
    private bool Check(Collider2D col, out IHpable entity)
    {
        IHpable moment;

        if ((moment = col.GetComponent <IHpable>()) != null && moment is Enemy == false)
        {
            entity = moment;
            return(true);
        }
        entity = null;
        return(false);
    }