更新至Unity6

This commit is contained in:
2024-10-14 15:31:04 +08:00
parent 6d3f85829b
commit c5192ae3ec
48 changed files with 48730 additions and 455 deletions

View File

@@ -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)