public void Cast(IMovementWizard wizard) { onCooldown = true; Vector3 direction = wizard.Direction(movement.direction); if (movement.normalizeDirection) { direction.Normalize(); } direction *= movement.power; if (movement.useDeltaTime) { direction *= Time.deltaTime; } wizard.Move(direction, movement.forceMode); wizard.Behaviour.StartCoroutine(DelayNextCast()); }
/// <summary> /// checks if the player triggered the expected input /// </summary> /// <returns></returns> public bool IsCasting(IMovementWizard wizard) { ///is the right input pressed and not on cooldown return(movement != null && !onCooldown && (movement.canBeCastInAir || !wizard.IsWizardFlying) && Evaluator.Invoke(movement.buttonTriggerName)); }