/// <summary> /// Updates the current information from the controller's state and sends it to the animator. /// </summary> public void UpdateAnimation(float timeStep) { if (hurting > 0) { hurting -= timeStep; animInfo.hurt = true; } else { animInfo.hurt = false; } animInfo.dashing = moveToPosition.dashing; if (weapon.IsAttacking()) { animInfo.attacking = true; animInfo.blocking = false; if (mouseInfo.position1.x < transform.position.x) { animInfo.mouseDirection = -1; } else { animInfo.mouseDirection = 1; } } else if (mouseInfo.holding && mouseInfo.holdDuration > delayUntilCharging) { animInfo.attacking = false; animInfo.blocking = true; if (mouseInfo.position1.x < transform.position.x) { animInfo.mouseDirection = -1; } else { animInfo.mouseDirection = 1; } } else { animInfo.attacking = false; animInfo.blocking = false; animInfo.mouseDirection = moveToPosition.moveDirection; } float speed = (canBeSlowed.value && !slowLeftSide.value) ? slowAmount.value : 1f; animScript.UpdateState(animInfo, speed); }