Ejemplo n.º 1
0
    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());
    }
Ejemplo n.º 2
0
 /// <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));
 }