Ejemplo n.º 1
0
 void Attacking()
 {
     if (Input.GetMouseButton(0) || Input.GetKey(KeyCode.C))
     {
         if (attackButtonRelease && weapon.AttackDown(aim) && weapon.IsMelee && weapon is WeaponStraight)
         {
             attackButtonRelease = false;
             mov2D.AddInstantTraslation(aim * ATTACK_DISPLACEMENT);
             //transform.position += aim * 0.25f;
         }
     }
     if (Input.GetMouseButtonUp(0) || Input.GetKeyUp(KeyCode.C))
     {
         attackButtonRelease = true;
         if (weapon.AttackUp(aim) && weapon.IsMelee && weapon is WeaponCharged)
         {
             mov2D.AddInstantTraslation(aim * ATTACK_DISPLACEMENT);
         }
     }
 }