示例#1
0
    public void dealDamage(GameObject reciever)
    {
        isHit = true;
        DamagableEntity rec = reciever.GetComponent <DamagableEntity>();

        rec.incomingDmg = attdmg;
        rec.damage();
    }
示例#2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Enemy" && type == "sword")
     {
         print("enemy");
     }
     if (other.gameObject.tag == "Enemy" && type == "sword" && isSwinging && Time.time - startTime2 > 0.5)
     {
         DamagableEntity enemy = other.gameObject.GetComponent <DamagableEntity>();
         enemy.incomingDmg = sworddmg;
         enemy.damage();
         print("hit");
         startTime2 = Time.time;
     }
 }