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

        if (Check(collision, out entity))
        {
            bitter = entity;
        }
    }
Esempio 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);
     }
 }
Esempio n. 5
0
 protected override void OnTriggerExit2D(Collider2D collision)
 {
     base.OnTriggerExit2D(collision);
     if (Check(collision, out IHpable entity))
     {
         if (entity == bitter)
         {
             bitter = null;
         }
     }
 }
Esempio 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);
    }