feat (slowdown): reduce the animation speed when in the slowdown area
This commit is contained in:
@@ -14,9 +14,10 @@ public class PlayerMovement : MonoBehaviour
|
||||
|
||||
private Vector3 moveDirection;
|
||||
|
||||
// used for root enemies
|
||||
// used by root enemies (area tell -> player do)
|
||||
private float baseWalkSpeed;
|
||||
private float slowMultiplier = 1f;
|
||||
private float slowMultiplier = 1.0f;
|
||||
private float animMultiplier = 1.0f;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -25,6 +26,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
animator = GetComponent<Animator>();
|
||||
headController = GetComponent<PlayerHeadController>();
|
||||
baseWalkSpeed = WalkSpeed;
|
||||
animator.speed = 1.0f;
|
||||
|
||||
if (m_rigidbody != null)
|
||||
{
|
||||
@@ -37,6 +39,12 @@ public class PlayerMovement : MonoBehaviour
|
||||
slowMultiplier = multiplier;
|
||||
}
|
||||
|
||||
public void ApplyAnimationSlow(float multiplier)
|
||||
{
|
||||
animMultiplier = multiplier;
|
||||
animator.speed = animMultiplier;
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
Vector2 m_moveAmt = input.MoveAmount;
|
||||
|
||||
Reference in New Issue
Block a user