更新至Unity6
This commit is contained in:
@@ -28,10 +28,10 @@ namespace Player
|
||||
rb.AddForce(_velocity.normalized * (Time.deltaTime * 50), ForceMode.Impulse);
|
||||
if (_velocity == Vector3.zero)
|
||||
{
|
||||
var temp = rb.velocity;
|
||||
var temp = rb.linearVelocity;
|
||||
temp = Vector3.ClampMagnitude(temp, 2);
|
||||
temp.y = rb.velocity.y;
|
||||
rb.velocity = temp;
|
||||
temp.y = rb.linearVelocity.y;
|
||||
rb.linearVelocity = temp;
|
||||
}
|
||||
|
||||
if (Input.GetKey(KeySettingManager.Instance.GetKey("Run")) &&
|
||||
@@ -46,7 +46,7 @@ namespace Player
|
||||
}
|
||||
|
||||
EventManager.Instance.OnPlayerRunning();
|
||||
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity + 2);
|
||||
rb.linearVelocity = Vector3.ClampMagnitude(rb.linearVelocity, maxVelocity + 2);
|
||||
}
|
||||
|
||||
if (!Input.GetKey(KeySettingManager.Instance.GetKey("Run")) &&
|
||||
@@ -61,7 +61,7 @@ namespace Player
|
||||
}
|
||||
|
||||
EventManager.Instance.OnPlayerWalking();
|
||||
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity);
|
||||
rb.linearVelocity = Vector3.ClampMagnitude(rb.linearVelocity, maxVelocity);
|
||||
}
|
||||
|
||||
if (KeySettingManager.Instance.Direction == Vector2.zero)
|
||||
|
||||
Reference in New Issue
Block a user