/// <summary> /// Handles leystrokes regarding magic attacks. /// </summary> void handleMagicAttack() { if (Input.GetButtonDown("Spell1")) { caster.Cast(0, target); } else if (Input.GetButtonDown("Spell2")) { caster.Cast(1, target); } else if (Input.GetButtonDown("Spell3")) { caster.Cast(2, target); } else if (Input.GetButtonDown("Spell4")) { caster.Cast(3, target); } if (Input.GetButtonUp("Spell1")) { caster.StopCast(0); } else if (Input.GetButtonUp("Spell2")) { caster.StopCast(1); } else if (Input.GetButtonUp("Spell3")) { caster.StopCast(1); } else if (Input.GetButtonUp("Spell4")) { caster.StopCast(2); } }